feat: 优化定时任务体验

This commit is contained in:
陈淳
2024-01-09 16:59:20 +08:00
parent 5357c813e4
commit 8c122b7e09
3 changed files with 30 additions and 7 deletions

View File

@@ -46,7 +46,10 @@ namespace Yi.Framework.SqlSugarCore.Uow
var unitOfWork = UnitOfWorkManager.Current;
if (unitOfWork == null)
{
throw new AbpException("A DbContext can only be created inside a unit of work!");
UnitOfWorkManager.Begin(true);
unitOfWork=UnitOfWorkManager.Current;
//取消工作单元强制性
//throw new AbpException("A DbContext can only be created inside a unit of work!");
}
//var sss= unitOfWork.ServiceProvider.GetRequiredService<TDbContext>();
//Console.WriteLine("反户的:"+sss.SqlSugarClient.ContextID);