Browse Source

Update exp to sql

pull/8/head
sunkaixuna 3 years ago
parent
commit
0c1195b287
  1. 10
      Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubAnd.cs
  2. 10
      Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs

10
Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubAnd.cs

@ -56,9 +56,19 @@ namespace SqlSugar
if (Regex.IsMatch(result, regex))
{
var value = GetValue(result, regex);
if (value is Expression)
{
var p = this.Context.Parameters.First(it => it.ParameterName == Regex.Match(result, regex).Groups[1].Value);
result = "AND " + SubTools.GetMethodValue(Context, value as Expression, ResolveExpressType.WhereMultiple);
argExp = value as Expression;
p.Value = argExp.ToString();
}
else
{
result = "AND " + value;
return result;
}
}
var selfParameterName = this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
if (this.Context.JoinIndex == 0)

10
Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs

@ -56,9 +56,19 @@ namespace SqlSugar
if (Regex.IsMatch(result, regex))
{
var value = GetValue(result, regex);
if (value is Expression)
{
var p = this.Context.Parameters.First(it => it.ParameterName == Regex.Match(result, regex).Groups[1].Value);
result = "WHERE " + SubTools.GetMethodValue(Context, value as Expression, ResolveExpressType.WhereMultiple);
argExp = value as Expression;
p.Value = argExp.ToString();
}
else
{
result = "WHERE " + value;
return result;
}
}
var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
if (this.Context.JoinIndex == 0)

Loading…
Cancel
Save