@@ -8,7 +8,6 @@ namespace OpenShock.Common.Query;
88public static class DBExpressionBuilderUtils
99{
1010 private static readonly MethodInfo EfFunctionsCollateMethodInfo = typeof ( RelationalDbFunctionsExtensions ) . GetMethod ( "Collate" ) ? . MakeGenericMethod ( typeof ( string ) ) ?? throw new MissingMethodException ( "EF.Functions" , "Collate(string,string)" ) ;
11- //private static readonly MethodInfo EfFunctionsLikeMethodInfo = typeof(NpgsqlDbFunctionsExtensions).GetMethod("Like", [typeof(DbFunctions), typeof(string), typeof(string)]) ?? throw new MissingMethodException("EF.Functions", "Like(string,string)");
1211 private static readonly MethodInfo EfFunctionsILikeMethodInfo = typeof ( NpgsqlDbFunctionsExtensions ) . GetMethod ( "ILike" , [ typeof ( DbFunctions ) , typeof ( string ) , typeof ( string ) ] ) ?? throw new MissingMethodException ( "EF.Functions" , "ILike(string,string)" ) ;
1312 private static readonly MethodInfo StringEqualsMethodInfo = typeof ( string ) . GetMethod ( "Equals" , [ typeof ( string ) ] ) ?? throw new MissingMethodException ( "string" , "Equals(string,StringComparison)" ) ;
1413 private static readonly MethodInfo StringStartsWithMethodInfo = typeof ( string ) . GetMethod ( "StartsWith" , [ typeof ( string ) ] ) ?? throw new MissingMethodException ( "string" , "StartsWith(string)" ) ;
@@ -124,18 +123,6 @@ private static ConstantExpression GetConstant(Type type, string value)
124123 }
125124 }
126125
127- /*
128- public static MethodCallExpression? BuildEfFunctionsLikeExpression(Type memberType, Expression memberExpr, string value)
129- {
130- if (memberType != typeof(string)) return null;
131-
132- var valueConstant = Expression.Constant(value, typeof(string));
133- var efFunctionsConstant = Expression.Constant(EF.Functions, typeof(DbFunctions));
134-
135- return Expression.Call(null, EfFunctionsLikeMethodInfo, efFunctionsConstant, memberExpr, valueConstant);
136- }
137- */
138-
139126 public static MethodCallExpression ? BuildEfFunctionsCollatedILikeExpression ( Type memberType , Expression memberExpr , string value )
140127 {
141128 if ( memberType != typeof ( string ) ) return null ;
0 commit comments