Browse Source

Add SqlFunc.JsonListObjectAny

Add SqlFunc.JsonArrayAny
pull/29/head
sunkaixuan 2 years ago
parent
commit
e75d50ba5a
  1. 8
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs
  2. 2
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs
  3. 10
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs
  4. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs

8
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

@ -681,5 +681,13 @@ namespace SqlSugar
model.Args[0].MemberName = name;
return AggregateSum(model);
}
public virtual string JsonListObjectAny(MethodCallExpressionModel model)
{
throw new NotImplementedException("Current database no support");
}
public virtual string JsonArrayAny(MethodCallExpressionModel model)
{
throw new NotImplementedException("Current database no support");
}
}
}

2
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs

@ -100,5 +100,7 @@ namespace SqlSugar
string JsonLike(MethodCallExpressionModel model);
string Collate(MethodCallExpressionModel model);
string AggregateSumNoNull(MethodCallExpressionModel model);
string JsonListObjectAny(MethodCallExpressionModel model);
string JsonArrayAny(MethodCallExpressionModel model);
}
}

10
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs

@ -256,5 +256,15 @@ namespace SqlSugar
public static DateTime Oracle_ToDate(string date,string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static string Oracle_ToChar(DateTime date, string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static int SqlServer_DateDiff(string dateType,DateTime date1,DateTime date2) { throw new NotSupportedException("Can only be used in expressions"); }
public static void JsonListObjectAny(object jsonListObject, string fieldName, string value)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static void JsonArrayAny(object jsonArray,string arrayValue)
{
throw new NotSupportedException("Can only be used in expressions");
}
}
}

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs

@ -752,6 +752,10 @@ namespace SqlSugar
return this.Context.DbMehtods.Collate(model);
case "AggregateSumNoNull":
return this.Context.DbMehtods.AggregateSumNoNull(model);
case "JsonListObjectAny":
return this.Context.DbMehtods.JsonListObjectAny(model);
case "JsonArrayAny":
return this.Context.DbMehtods.JsonArrayAny(model);
default:
break;
}

Loading…
Cancel
Save