mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 04:59:34 +08:00
Update .net core project
This commit is contained in:
parent
e17c55e231
commit
675a10cdeb
@ -57,12 +57,27 @@ namespace SqlSugar
|
||||
private string GetWhereSql(MethodCallExpression memberExp)
|
||||
{
|
||||
var whereExp = memberExp.Arguments[1];
|
||||
if (PropertyShortName.HasValue()&& Navigat!=null&& Navigat.NavigatType==NavigateType.OneToMany)
|
||||
if (PropertyShortName.HasValue() && Navigat != null && Navigat.NavigatType == NavigateType.OneToMany)
|
||||
{
|
||||
InitType(whereExp);
|
||||
var result = this.methodCallExpressionResolve.GetNewExpressionValue(whereExp, ResolveExpressType.WhereMultiple);
|
||||
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
|
||||
{
|
||||
InitType(whereExp);
|
||||
|
@ -28,5 +28,9 @@ namespace SqlSugar
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user