Update .net core project

This commit is contained in:
sunkaixuan 2022-07-23 15:10:21 +08:00
parent e17c55e231
commit 675a10cdeb
2 changed files with 20 additions and 1 deletions

View File

@ -63,6 +63,21 @@ namespace SqlSugar
var result = this.methodCallExpressionResolve.GetNewExpressionValue(whereExp, ResolveExpressType.WhereMultiple); var result = this.methodCallExpressionResolve.GetNewExpressionValue(whereExp, ResolveExpressType.WhereMultiple);
return result; return result;
} }
else if (whereExp!=null&&whereExp.Type == typeof(List<IConditionalModel>))
{
var value = ExpressionTool.GetExpressionValue(whereExp) as List<IConditionalModel>;
//this.context.Utilities.Context.Queryable<object>().Where(value).ToList();
if (value.HasValue())
{
var sqlObj = this.context.Queryable<object>().SqlBuilder.ConditionalModelToSql(value, 0);
methodCallExpressionResolve.Context.Parameters.AddRange(sqlObj.Value);
return sqlObj.Key;
}
else
{
return " 1=1 ";
}
}
else else
{ {
InitType(whereExp); InitType(whereExp);

View File

@ -28,5 +28,9 @@ namespace SqlSugar
{ {
return new List<T>() { thisValue }; return new List<T>() { thisValue };
} }
public static bool Any<T>(this IEnumerable<T> thisValue, IEnumerable<IConditionalModel> conditionalModels)
{
throw new Exception("Can only be used in expressions");
}
} }
} }