Merge branch 'master' of gitee.com:dotnetchina/SqlSugar

This commit is contained in:
sunkaixuan 2024-09-24 14:31:26 +08:00
commit e506a48e45

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
@ -23,7 +23,7 @@ namespace SqlSugar
public DiffLogModel diffModel { get; set; }
public List<string> tempPrimaryKeys { get; set; }
internal Action RemoveCacheFunc { get; set; }
internal List<T> DeleteObjects { get; set; }
public List<T> DeleteObjects { get; set; }
public EntityInfo EntityInfo
{
get
@ -690,7 +690,7 @@ namespace SqlSugar
}
private void After(string sql)
protected virtual void After(string sql)
{
if (this.IsEnableDiffLogEvent)
{
@ -711,7 +711,7 @@ namespace SqlSugar
DataChangesAop(this.DeleteObjects);
}
private void Before(string sql)
protected virtual void Before(string sql)
{
if (this.IsEnableDiffLogEvent)
{
@ -727,7 +727,7 @@ namespace SqlSugar
}
}
private List<DiffLogTableInfo> GetDiffTable(string sql, List<SugarParameter> parameters)
protected virtual List<DiffLogTableInfo> GetDiffTable(string sql, List<SugarParameter> parameters)
{
List<DiffLogTableInfo> result = new List<DiffLogTableInfo>();
var whereSql = Regex.Replace(sql, ".* WHERE ", "", RegexOptions.Singleline);
@ -756,7 +756,7 @@ namespace SqlSugar
}
return result;
}
private void DataAop(object deleteObj)
protected virtual void DataAop(object deleteObj)
{
var dataEvent = this.Context.CurrentConnectionConfig.AopEvents?.DataExecuting;
if (deleteObj != null&& dataEvent!=null)
@ -770,7 +770,7 @@ namespace SqlSugar
dataEvent(deleteObj,model);
}
}
private void DataChangesAop(List<T> deleteObjs)
protected virtual void DataChangesAop(List<T> deleteObjs)
{
var dataEvent = this.Context.CurrentConnectionConfig.AopEvents?.DataChangesExecuted;
if(dataEvent != null&&deleteObjs != null)