mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Synchronization code
This commit is contained in:
@@ -514,12 +514,24 @@ namespace SqlSugar
|
||||
var method = item as MethodCallExpression;
|
||||
var queryable = this.Context.Queryable<object>();
|
||||
if (method.Method.Name == "Where")
|
||||
{
|
||||
if (method.Arguments[1].Type == typeof(List<IConditionalModel>))
|
||||
{
|
||||
//var x=method.Arguments[1];
|
||||
var conditionals = ExpressionTool.GetExpressionValue(method.Arguments[1]) as List<IConditionalModel>;
|
||||
var whereObj = queryable.QueryBuilder.Builder.ConditionalModelToSql(conditionals);
|
||||
where.Add(whereObj.Key);
|
||||
if(whereObj.Value!=null)
|
||||
result.Parameters.AddRange(whereObj.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckHasRootShortName(method.Arguments[0], method.Arguments[1]);
|
||||
var exp = method.Arguments[1];
|
||||
where.Add(" " + queryable.QueryBuilder.GetExpressionValue(exp, ResolveExpressType.WhereSingle).GetString());
|
||||
SetTableShortName(result, queryable);
|
||||
}
|
||||
}
|
||||
else if (method.Method.Name == "WhereIF")
|
||||
{
|
||||
var isOk = LambdaExpression.Lambda(method.Arguments[1]).Compile().DynamicInvoke();
|
||||
|
||||
@@ -28,7 +28,11 @@ namespace SqlSugar
|
||||
{
|
||||
return new List<T>() { thisValue };
|
||||
}
|
||||
public static bool Any<T>(this IEnumerable<T> thisValue, IEnumerable<IConditionalModel> conditionalModels)
|
||||
public static bool Any<T>(this IEnumerable<T> thisValue, List<IConditionalModel> conditionalModels)
|
||||
{
|
||||
throw new Exception("Can only be used in expressions");
|
||||
}
|
||||
public static IEnumerable<T> Where<T>(this IEnumerable<T> thisValue, List<IConditionalModel> conditionalModels)
|
||||
{
|
||||
throw new Exception("Can only be used in expressions");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user