0
leonkosak created
using (_session.Use(desiredTenant.Id, desiredUser.Id)) { //await CreateNewCorrectiveMaintenanceRequest(inputInternal); var output = inputInternal.MapTo<MaintenanceRequest>(); await _maintenanceRequestManager.CreateNewCorrectiveMaintenanceRequestAsync(output); } I can confirm, that desiredUser.Id has non-null value, but the entity in dababase has CreatorUserId null.
Am I missing something?
1 Answer(s)
-
0
Try to
SaveChanges
in the using code block.using (_session.Use(desiredTenant.Id, desiredUser.Id)) { //await CreateNewCorrectiveMaintenanceRequest(inputInternal); var output = inputInternal.MapTo<MaintenanceRequest>(); await _maintenanceRequestManager.CreateNewCorrectiveMaintenanceRequestAsync(output); CurrentUnitOfWork.SaveChanges(); }