Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

_session.Use(tenantId, userId) CreatorUserId is null #8690


User avatar
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)
  • User Avatar
    0
    maliming created
    Support Team

    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();
    }