Browse Source

Update exp to sql

pull/17/head
sunkaixuan 3 years ago
parent
commit
28a09190f6
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs
  2. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubSelect.cs

2
Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs

@ -265,7 +265,7 @@ namespace SqlSugar
if (isSingleTableHasSubquery)
{
Check.Exception(!string.IsNullOrEmpty(this.TableShortName) && resolveExpress.SingleTableNameSubqueryShortName != this.TableShortName, "{0} and {1} need same name", resolveExpress.SingleTableNameSubqueryShortName, this.TableShortName);
this.TableShortName = resolveExpress.SingleTableNameSubqueryShortName;
this.TableShortName =this.Builder.GetTranslationColumnName(resolveExpress.SingleTableNameSubqueryShortName);
}
return result;
}

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubSelect.cs

@ -67,7 +67,7 @@ namespace SqlSugar
var parameters = (exp.Arguments[0] as LambdaExpression).Parameters;
if (parameters != null && parameters.Count > 0)
{
this.Context.CurrentShortName = this.Context.SqlTranslationLeft + parameters[0] + this.Context.SqlTranslationRight;
this.Context.CurrentShortName = this.Context.GetTranslationColumnName(parameters[0].ObjToString());
}
}
@ -79,7 +79,7 @@ namespace SqlSugar
var parameters = (exp.Arguments[1] as LambdaExpression).Parameters;
if (parameters != null && parameters.Count > 0)
{
this.Context.CurrentShortName = this.Context.SqlTranslationLeft + parameters[0] + this.Context.SqlTranslationRight;
this.Context.CurrentShortName = this.Context.GetTranslationColumnName(parameters[0].ObjToString());
}
}

Loading…
Cancel
Save