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

@ -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);

View File

@ -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");
}
}
}