Synchronization code

This commit is contained in:
sunkaixuan 2023-05-30 12:27:41 +08:00
parent c5d4970232
commit b0bd0d9776
2 changed files with 6 additions and 4 deletions

View File

@ -43,7 +43,8 @@ namespace SqlSugar
var argExp = exp.Arguments[0];
var copyContext = this.Context;
if (this.Context.JoinIndex > 0)
var pars = ExpressionTool.GetParameters(expression).Distinct();
if (this.Context.JoinIndex > 0|| pars.Count()>1)
{
copyContext = this.Context.GetCopyContextWithMapping();
copyContext.IsSingle = false;
@ -51,7 +52,7 @@ namespace SqlSugar
var result = "AND " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
if (this.Context.JoinIndex > 0)
if (this.Context.JoinIndex > 0 || pars.Count() > 1)
{
this.Context.Parameters.AddRange(copyContext.Parameters);
this.Context.Index = copyContext.Index;

View File

@ -46,14 +46,15 @@ namespace SqlSugar
}
var argExp = exp.Arguments[0];
var copyContext = this.Context;
if (this.Context.JoinIndex > 0)
var pars=ExpressionTool.GetParameters(expression).Distinct();
if (this.Context.JoinIndex > 0|| pars.Count()>1)
{
copyContext = this.Context.GetCopyContextWithMapping();
copyContext.IsSingle = false;
}
var result = "WHERE " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
if (this.Context.JoinIndex > 0)
if (this.Context.JoinIndex > 0 ||pars.Count() > 1)
{
this.Context.Parameters.AddRange(copyContext.Parameters);
this.Context.Index = copyContext.Index;