添加数据库上下文改为 services.Add() 方法,TryAdd() 让后面的 YiRbacDbContext 无法注入,导致数据权限过滤失效了
This commit is contained in:
@@ -26,7 +26,7 @@ public static class SqlSugarCoreExtensions
|
|||||||
ServiceLifetime serviceLifetime = ServiceLifetime.Transient)
|
ServiceLifetime serviceLifetime = ServiceLifetime.Transient)
|
||||||
where TDbContext : class, ISqlSugarDbContextDependencies
|
where TDbContext : class, ISqlSugarDbContextDependencies
|
||||||
{
|
{
|
||||||
services.TryAdd(new ServiceDescriptor(
|
services.Add(new ServiceDescriptor(
|
||||||
typeof(ISqlSugarDbContextDependencies),
|
typeof(ISqlSugarDbContextDependencies),
|
||||||
typeof(TDbContext),
|
typeof(TDbContext),
|
||||||
serviceLifetime));
|
serviceLifetime));
|
||||||
|
|||||||
Reference in New Issue
Block a user