开发者

Modifiy telerik grid filter LINQ entity expression

开发者 https://www.devze.com 2023-01-29 19:59 出处:网络
Hello everybody I\'m using the Telerik ASP.NET MVC2 grid and i need to change the way how the filters are non-case sensitive because the DB bugs when using lower method.

Hello everybody I'm using the Telerik ASP.NET MVC2 grid and i need to change the way how the filters are non-case sensitive because the DB bugs when using lower method. So, i want to create a linq expression that will test every case possibilities. (for example "aaa","Aaa","AaA" etc...) I need to do that in the following code.

Thank's by advance.

   private static Expression GenerateCaseInsensitiveStringMethodCall(MethodInfo methodInfo, Expression left, Expression right)
    {
      if (methodInfo.IsStatic)
        return  Expression.Call(methodInfo,new[] {  left, right });
      else
        return Expression.Call(left, methodInfo,right);
      /*
      var leftToLower = GenerateToLowerCall(left);
      var rightToLower = GenerateToLowerCall(right);

      if (me开发者_如何学编程thodInfo.IsStatic)
      {
        return Expression.Call(methodInfo, new[] { leftToLower, rightToLower });
      }

      return Expression.Call(leftToLower, methodInfo, rightToLower);*/


In file FilterOperationExtensions.cs,

change method GenerateToLowerCall to just return the liftedtoEmpty variable

0

精彩评论

暂无评论...
验证码 换一张
取 消