diff --git a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index 5e8390350..c8944dd76 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -191,6 +191,7 @@ namespace SqlSugar public IDeleteable Where(string whereString, SugarParameter parameter) { + DeleteBuilder.WhereInfos.Add(whereString); if (DeleteBuilder.Parameters == null) { DeleteBuilder.Parameters = new List(); @@ -200,6 +201,7 @@ namespace SqlSugar } public IDeleteable Where(string whereString, SugarParameter[] parameters) { + DeleteBuilder.WhereInfos.Add(whereString); if (DeleteBuilder.Parameters == null) { DeleteBuilder.Parameters = new List(); @@ -209,6 +211,7 @@ namespace SqlSugar } public IDeleteable Where(string whereString, List parameters) { + DeleteBuilder.WhereInfos.Add(whereString); if (DeleteBuilder.Parameters == null) { DeleteBuilder.Parameters = new List(); diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index c8944dd76..72b4189ea 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -52,7 +52,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; } @@ -161,8 +161,9 @@ namespace SqlSugar { var expResult = DeleteBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle); var whereString = expResult.GetResultString(); - if (expression.ToString().Contains("Subqueryable()")){ - whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".",this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + "."); + if (expression.ToString().Contains("Subqueryable()")) + { + whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + "."); } DeleteBuilder.WhereInfos.Add(whereString); return this; @@ -287,7 +288,7 @@ namespace SqlSugar var lamResult = DeleteBuilder.GetExpressionValue(inField, ResolveExpressType.FieldSingle); var fieldName = lamResult.GetResultString(); tempPrimaryKeys = new List() { fieldName }; - var result = In(primaryKeyValue);; + var result = In(primaryKeyValue); ; tempPrimaryKeys = null; return this; } @@ -406,7 +407,8 @@ namespace SqlSugar this.Context.CurrentConnectionConfig.AopEvents.OnDiffLogEvent(diffModel); this.Context.Ado.IsDisableMasterSlaveSeparation = isDisableMasterSlaveSeparation; } - if (this.RemoveCacheFunc != null) { + if (this.RemoveCacheFunc != null) + { this.RemoveCacheFunc(); } }