This "How-to" question is in continuation of the post I posted earlier: Web API transaction management and multiple DWs update/save changes in single transaction. (appeon.com) and got response as well.
Logan,
Thanks very much for the example of controller code. it is working well.
I have a question I am getting this error "System.ArgumentNullException: Value cannot be null. (Parameter 'name')" and I am thinking it is because "datacontext" is missing in below code snippet:
IDataStore ds1= dataUnpacker.GetDataStore("dw_1");
IDataStore ds2= dataUnpacker.GetDataStore("dw_2");
I am not able to define datacontext in controller & call it in above code snippet.
any documentation/ "how-to" define and use Data Context in Controller? in my Service Implementation (Service Class) I already have data context defined.
Thanks !
even though I pass data context, it still gives me same error.
Any idea/suggestion what could be causing this?
Thanks.
Regards - Francisco
Except for the exception, could you provide your sample PB and C# project here?
You can also refer to the code that contains a similar usage:
https://docs.appeon.com/powerscriptmigrator2022/PB_to_CSharp_Porting_Business_Logics_with_Minimum_Refactoring_Hassle/#prerequisites
Search "dataUnpacker.GetDataStore" in the finished C# solution.
Regards, Logan