From 2f3c567a212c1cd2d9335d27995b86ab3bc5e49e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 14 Dec 2022 19:51:14 +0800 Subject: [PATCH] Synchronization code --- .../DeleteProvider/DeleteableProvider.cs | 16 +++++++++++++--- Src/Asp.Net/SqlSugar/Interface/IDeleteable.cs | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index 2f0c50a20..c0d130f73 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -53,7 +53,7 @@ namespace SqlSugar string sql; SugarParameter[] paramters; _ExecuteCommand(out sql, out paramters); - var result =await Db.ExecuteCommandAsync(sql, paramters); + var result = await Db.ExecuteCommandAsync(sql, paramters); After(sql); return result; } @@ -61,7 +61,7 @@ namespace SqlSugar { return await ExecuteCommandAsync() > 0; } - public IDeleteable AsType(Type tableNameType) + public IDeleteable AsType(Type tableNameType) { return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName); } @@ -79,7 +79,17 @@ namespace SqlSugar this.Context.MappingTables.Add(entityName, tableName); return this; ; } - + public IDeleteable EnableDiffLogEventIF(bool isEnableDiffLogEvent, object businessData = null) + { + if (isEnableDiffLogEvent) + { + return EnableDiffLogEvent(businessData); + } + else + { + return this; + } + } public IDeleteable EnableDiffLogEvent(object businessData = null) { diff --git a/Src/Asp.Net/SqlSugar/Interface/IDeleteable.cs b/Src/Asp.Net/SqlSugar/Interface/IDeleteable.cs index 249418b4c..54470a02a 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IDeleteable.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IDeleteable.cs @@ -34,6 +34,7 @@ namespace SqlSugar IDeleteable WhereColumns(List list,Expression> columns); IDeleteable WhereColumns(List> columns); IDeleteable Where(List conditionalModels); + IDeleteable EnableDiffLogEventIF(bool isEnableDiffLogEvent, object businessData = null); IDeleteable EnableDiffLogEvent(object businessData = null); IDeleteable RemoveDataCache(); IDeleteable RemoveDataCache(string likeString);