diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore.Abstractions/ISqlSugarDbContext.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore.Abstractions/ISqlSugarDbContext.cs
index cd4f9dce..cb736291 100644
--- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore.Abstractions/ISqlSugarDbContext.cs
+++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore.Abstractions/ISqlSugarDbContext.cs
@@ -14,7 +14,7 @@ namespace Yi.Framework.SqlSugarCore.Abstractions
/// SqlSugarDb
///
ISqlSugarClient SqlSugarClient { get; }
-
+
///
/// 数据库备份
///
diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/DefaultSqlSugarDbContext.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/DefaultSqlSugarDbContext.cs
index 0c13e6bf..9ba17dc3 100644
--- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/DefaultSqlSugarDbContext.cs
+++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/DefaultSqlSugarDbContext.cs
@@ -12,6 +12,7 @@ using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
+using Volo.Abp.Uow;
using Volo.Abp.Users;
using Yi.Framework.SqlSugarCore.Abstractions;
@@ -19,13 +20,13 @@ namespace Yi.Framework.SqlSugarCore;
public class DefaultSqlSugarDbContext : SqlSugarDbContext
{
-
protected DbConnOptions Options => LazyServiceProvider.LazyGetRequiredService>().Value;
protected ICurrentUser CurrentUser => LazyServiceProvider.GetRequiredService();
protected IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetRequiredService();
protected ILoggerFactory Logger => LazyServiceProvider.LazyGetRequiredService();
protected ICurrentTenant CurrentTenant => LazyServiceProvider.LazyGetRequiredService();
protected IDataFilter DataFilter => LazyServiceProvider.LazyGetRequiredService();
+ public IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService();
protected virtual bool IsMultiTenantFilterEnabled => DataFilter?.IsEnabled() ?? false;
protected virtual bool IsSoftDeleteFilterEnabled => DataFilter?.IsEnabled() ?? false;
@@ -35,6 +36,7 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
public DefaultSqlSugarDbContext(IAbpLazyServiceProvider lazyServiceProvider) : base(lazyServiceProvider)
{
}
+
protected override void CustomDataFilter(ISqlSugarClient sqlSugarClient)
{
if (IsSoftDeleteFilterEnabled)
@@ -123,7 +125,7 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
}
- //领域事件
+ //实体变更领域事件
switch (entityInfo.OperationType)
{
case DataFilterType.InsertByObject:
@@ -166,6 +168,14 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
break;
}
+
+
+ //实体领域事件-所有操作类型
+ if (entityInfo.PropertyName == nameof(IEntity