I try to use background job to excute some domain service about create / update And data is succeed to create / update to database But, I found that the record without CreatorId / LastModifiierId After debug I'm understand it because without currentuser via backgroud job So I try to manually set to entity It work for create ,but fail in update It will be set to null when currentuser id have no value
Is these any other solution for me?
public class AttendEmployeeRoteScheduleBackgroundJob : AsyncBackgroundJob<AttendEmployeeRoteScheduleGenerateConditionDto>, ITransientDependency
{
private readonly AttendEmployeeRoteScheduleDomainService attendEmployeeRoteSchedulesAppService;
public AttendEmployeeRoteScheduleBackgroundJob(AttendEmployeeRoteScheduleDomainService attendEmployeeRoteSchedulesAppService)
{
this.attendEmployeeRoteSchedulesAppService = attendEmployeeRoteSchedulesAppService;
}
public override Task ExecuteAsync(AttendEmployeeRoteScheduleGenerateConditionDto args)
{
return attendEmployeeRoteSchedulesAppService.GenerateAsync(args);
}
}