Browse Source

Synchronization code

pull/40/head
sunkaixuan 1 year ago
parent
commit
320838cb7e
  1. 10
      Src/Asp.NetCore2/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs
  2. 9
      Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

10
Src/Asp.NetCore2/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

@ -236,8 +236,16 @@ namespace SqlSugar
}
else if (expResult.IsNavicate)
{
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
if (this.DeleteBuilder.AsName.HasValue())
{
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".","");
}
else
{
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
}
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
}
DeleteBuilder.WhereInfos.Add(whereString);
return this;

9
Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -793,7 +793,14 @@ namespace SqlSugar
}
else if (expResult.IsNavicate)
{
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
if (this.UpdateBuilder.TableName.HasValue())
{
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", "");
}
else
{
whereString = whereString.Replace(expression.Parameters.First().Name + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
}
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
}
UpdateBuilder.WhereValues.Add(whereString);

Loading…
Cancel
Save