Browse Source

Add SqlFunc.SplitIn(+3)

pull/40/head
sunkaixuan 1 year ago
parent
commit
27d8d3cee5
  1. 6
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs
  2. 5
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs

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

@ -770,6 +770,12 @@ namespace SqlSugar
var value1 = MergeString(value, "','"); var value1 = MergeString(value, "','");
var value2 = MergeString("','", value); var value2 = MergeString("','", value);
var value3 = MergeString("','", value, "','"); var value3 = MergeString("','", value, "','");
if (model.Args.Count == 3)
{
value1 = value1.Replace("','", model.Args[2].MemberName+"" );
value2 = value2.Replace("','", model.Args[2].MemberName + "" );
value3 = value3.Replace("','", model.Args[2].MemberName + "" );
}
var likeString1 = var likeString1 =
StartsWith(new MethodCallExpressionModel() { Args = new List<MethodCallExpressionArgs>() { StartsWith(new MethodCallExpressionModel() { Args = new List<MethodCallExpressionArgs>() {
new MethodCallExpressionArgs(){ IsMember=true, MemberName=fullString }, new MethodCallExpressionArgs(){ IsMember=true, MemberName=fullString },

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

@ -344,6 +344,11 @@ namespace SqlSugar
throw new NotSupportedException("Can only be used in expressions"); throw new NotSupportedException("Can only be used in expressions");
} }
public static bool SplitIn(string CommaSegmentationString, string inValue,char splitChar)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static bool ListAny<T>(List<T> listConstant, Expression<Func<T,bool>> expression) public static bool ListAny<T>(List<T> listConstant, Expression<Func<T,bool>> expression)
{ {
throw new NotSupportedException("Can only be used in expressions"); throw new NotSupportedException("Can only be used in expressions");

Loading…
Cancel
Save