Update Core

This commit is contained in:
sunkaixuan
2022-05-20 15:28:44 +08:00
parent f36334b59c
commit 05b6c04479
3 changed files with 48 additions and 3 deletions

View File

@@ -322,6 +322,7 @@ namespace SqlSugar
public string GetNewExpressionValue(Expression item)
{
var newContext = this.Context.GetCopyContextWithMapping();
newContext.SugarContext = this.Context.SugarContext;
newContext.Resolve(item, this.Context.IsJoin ? ResolveExpressType.WhereMultiple : ResolveExpressType.WhereSingle);
this.Context.Index = newContext.Index;
this.Context.ParameterIndex = newContext.ParameterIndex;
@@ -331,6 +332,19 @@ namespace SqlSugar
}
return newContext.Result.GetResultString();
}
public string GetNewExpressionValue(Expression item,ResolveExpressType type)
{
var newContext = this.Context.GetCopyContextWithMapping();
newContext.SugarContext = this.Context.SugarContext;
newContext.Resolve(item, type);
this.Context.Index = newContext.Index;
this.Context.ParameterIndex = newContext.ParameterIndex;
if (newContext.Parameters.HasValue())
{
this.Context.Parameters.AddRange(newContext.Parameters);
}
return newContext.Result.GetResultString();
}
protected void ResolveNewExpressions(ExpressionParameter parameter, Expression item, string asName)
{