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 !
System.ArgumentNullException: Value cannot be null. (Parameter 'name')
at SnapObjects.Commons.Check.NotNull[T](T value, String parameterName)
at DWNet.Data.DataStoreBase..ctor(String name)
at DWNet.Data.DataStore..ctor(String dataObject)
at DWNet.Data.DataStoreUnpackerExtensions.GetDataStore(IDataUnpacker dataUnPackage, String key, DataContext context, String name, DataFormatSetting setting)
at DWNet.Data.DataStoreUnpackerExtensions.GetDataStore(IDataUnpacker dataUnPackage, String key, DataContext context, String name)
at DWNet.Data.DataStoreUnpackerExtensions.GetDataStore(IDataUnpacker dataUnPackage, String key, DataContext context)
at Xyz_poc_only_Abc.Controllers.AbcServiceController.Modify(IDataUnpacker dataUnpacker) in C:\Xyz_Appeon_POC\Xyz_poc_only\Xyz_poc_only\Controllers\AbcServiceController.cs:line 86
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
Regards - Francisco