mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Synchronization code
This commit is contained in:
@@ -108,6 +108,7 @@ namespace SqlSugar
|
||||
Where(SqlBuilder.SqlFalse);
|
||||
return this;
|
||||
}
|
||||
DataAop(deleteObjs);
|
||||
string tableName = this.Context.EntityMaintenance.GetTableName<T>();
|
||||
var primaryFields = this.GetPrimaryKeys();
|
||||
var isSinglePrimaryKey = primaryFields.Count == 1;
|
||||
@@ -620,5 +621,18 @@ namespace SqlSugar
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private void DataAop(object deleteObj)
|
||||
{
|
||||
var dataEvent = this.Context.CurrentConnectionConfig.AopEvents?.DataExecuting;
|
||||
if (deleteObj != null&& dataEvent!=null)
|
||||
{
|
||||
var model = new DataFilterModel()
|
||||
{
|
||||
OperationType = DataFilterType.DeleteByObject,
|
||||
EntityValue = deleteObj,
|
||||
};
|
||||
dataEvent(deleteObj,model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,8 @@ namespace SqlSugar
|
||||
public enum DataFilterType
|
||||
{
|
||||
UpdateByObject = 0,
|
||||
InsertByObject = 1
|
||||
InsertByObject = 1,
|
||||
DeleteByObject =2
|
||||
}
|
||||
public class DataFilterModel
|
||||
{
|
||||
|
Reference in New Issue
Block a user