Browse Source

Update exp to sql

pull/33/head
sunkaixuan 1 year ago
parent
commit
376efdc981
  1. 5
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubFirst.cs
  2. 5
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubToList.cs

5
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubFirst.cs

@ -141,7 +141,10 @@ namespace SqlSugar
var newMemExp = (bodyExp as MemberInitExpression);
var parameters = ExpressionTool.GetParameters(exp);
InitType(exp);
SetShortName(exp, null);
if (parameters.Any())
{
this.Context.CurrentShortName = this.Context.GetTranslationColumnName(parameters.FirstOrDefault().Name);
}
Check.ExceptionEasy(newMemExp == null, $"Subquery ToList(exp,true) expression {exp.ToString()} can only be it=>new class(){{Id = it.id}}", $"子查询ToList(exp,true)表达式{exp.ToString()}只能是it=>new class(){{ id=it.Id}}");
var dic = ExpressionTool.GetMemberBindingItemList(newMemExp.Bindings);
var db = this.Context.SugarContext.Context;

5
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubToList.cs

@ -141,7 +141,10 @@ namespace SqlSugar
var newMemExp = (bodyExp as MemberInitExpression);
var parameters = ExpressionTool.GetParameters(exp);
InitType(exp);
SetShortName(exp, null);
if (parameters.Any())
{
this.Context.CurrentShortName = this.Context.GetTranslationColumnName(parameters.FirstOrDefault().Name);
}
Check.ExceptionEasy(newMemExp == null, $"Subquery ToList(exp,true) expression {exp.ToString()} can only be it=>new class(){{Id = it.id}}", $"子查询ToList(exp,true)表达式{exp.ToString()}只能是it=>new class(){{ id=it.Id}}");
var dic=ExpressionTool.GetMemberBindingItemList(newMemExp.Bindings);
var db = this.Context.SugarContext.Context;

Loading…
Cancel
Save