New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does aspnetboilerplate track entity history in backgroundjobs and workers? #6493
Comments
Copuld you share a sample entity and a sample job to reproduce this ? |
In this project https://github.com/Omital/ClientInfoProvider |
Does that work if you wrap data save operation in the background job with this https://aspnetboilerplate.com/Pages/Documents/Abp-Session#user-identifier |
What if Multitenancy is disabled? |
In that case, you can try with default tenant's admin user. It should be TenantId=1, UserId=2 |
I wrap my code with |
Thanks, I will check it. |
@Omital I figure out the problem, even if you use [UnitOfWork(true)]
public override async Task ExecuteAsync(SampleJobArgs args)
{
using (AbpSession.Use(1, 2))
{
BaseData bd = new BaseData()
{
Name = Clock.Now.Ticks.ToString()
};
await _baseDataRepo.InsertAsync(bd);
}
} to [UnitOfWork(true)]
public override async Task ExecuteAsync(SampleJobArgs args)
{
using (AbpSession.Use(1, 2))
{
BaseData bd = new BaseData()
{
Name = Clock.Now.Ticks.ToString()
};
await _baseDataRepo.InsertAsync(bd);
CurrentUnitOfWork.SaveChanges();
}
} |
It seems aspnetboilerplate does not track entity change history in BackgroundJobs and Workers. Is any option to enable or implement it?
The text was updated successfully, but these errors were encountered: