Browse Source

-

pull/12/MERGE
skx 5 years ago
parent
commit
4c1d8aa73d
  1. 3
      Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs
  2. 6
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

3
Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

@ -191,6 +191,7 @@ namespace SqlSugar
public IDeleteable<T> Where(string whereString, SugarParameter parameter)
{
DeleteBuilder.WhereInfos.Add(whereString);
if (DeleteBuilder.Parameters == null)
{
DeleteBuilder.Parameters = new List<SugarParameter>();
@ -200,6 +201,7 @@ namespace SqlSugar
}
public IDeleteable<T> Where(string whereString, SugarParameter[] parameters)
{
DeleteBuilder.WhereInfos.Add(whereString);
if (DeleteBuilder.Parameters == null)
{
DeleteBuilder.Parameters = new List<SugarParameter>();
@ -209,6 +211,7 @@ namespace SqlSugar
}
public IDeleteable<T> Where(string whereString, List<SugarParameter> parameters)
{
DeleteBuilder.WhereInfos.Add(whereString);
if (DeleteBuilder.Parameters == null)
{
DeleteBuilder.Parameters = new List<SugarParameter>();

6
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

@ -161,7 +161,8 @@ namespace SqlSugar
{
var expResult = DeleteBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle);
var whereString = expResult.GetResultString();
if (expression.ToString().Contains("Subqueryable()")){
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);
@ -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();
}
}

Loading…
Cancel
Save