fix: 修复移除属性注入
This commit is contained in:
@@ -32,6 +32,9 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
|
||||
protected IEntityChangeEventHelper EntityChangeEventHelper =>
|
||||
LazyServiceProvider.LazyGetService<IEntityChangeEventHelper>(NullEntityChangeEventHelper.Instance);
|
||||
|
||||
public DefaultSqlSugarDbContext(IAbpLazyServiceProvider lazyServiceProvider) : base(lazyServiceProvider)
|
||||
{
|
||||
}
|
||||
protected override void CustomDataFilter(ISqlSugarClient sqlSugarClient)
|
||||
{
|
||||
if (IsSoftDeleteFilterEnabled)
|
||||
@@ -204,4 +207,5 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
|
||||
entityColumnInfo.IsPrimarykey = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,8 +7,14 @@ namespace Yi.Framework.SqlSugarCore;
|
||||
|
||||
public abstract class SqlSugarDbContext : ISqlSugarDbContextDependencies
|
||||
{
|
||||
//属性注入
|
||||
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
|
||||
protected IAbpLazyServiceProvider LazyServiceProvider { get; }
|
||||
|
||||
public SqlSugarDbContext(IAbpLazyServiceProvider lazyServiceProvider)
|
||||
{
|
||||
this.LazyServiceProvider = lazyServiceProvider;
|
||||
}
|
||||
|
||||
|
||||
protected ISqlSugarClient SqlSugarClient { get;private set; }
|
||||
public int ExecutionOrder => 0;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using Volo.Abp.Data;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Users;
|
||||
using Yi.Framework.Rbac.Domain.Authorization;
|
||||
using Yi.Framework.Rbac.Domain.Entities;
|
||||
@@ -24,6 +25,9 @@ namespace Yi.Framework.Rbac.SqlSugarCore
|
||||
}
|
||||
|
||||
|
||||
public YiRbacDbContext(IAbpLazyServiceProvider lazyServiceProvider) : base(lazyServiceProvider)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据权限过滤
|
||||
/// </summary>
|
||||
@@ -86,5 +90,6 @@ namespace Yi.Framework.Rbac.SqlSugarCore
|
||||
sqlSugarClient.QueryFilter.AddTableFilter(expUser.ToExpression());
|
||||
sqlSugarClient.QueryFilter.AddTableFilter(expRole.ToExpression());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,8 @@ namespace Yi.Abp.SqlSugarCore
|
||||
{
|
||||
public class YiDbContext : SqlSugarDbContext
|
||||
{
|
||||
public YiDbContext(IAbpLazyServiceProvider lazyServiceProvider) : base(lazyServiceProvider)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user