Click here to Skip to main content
12,630,410 members (28,396 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: LINQ
I got below Functions for where clause
public static IQueryable<T> Where<T>(this IQueryable<T> source, string predicate, params object[] values)
       {
           return (IQueryable<T>)Where((IQueryable)source, predicate, values);
       }
 
       public static IQueryable Where(this IQueryable source, string predicate, params object[] values) {
           if (source == null) throw new ArgumentNullException("source");
           if (predicate == null) throw new ArgumentNullException("predicate");
           LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, typeof(bool), predicate, values);
           return source.Provider.CreateQuery(
               Expression.Call(
                   typeof(Queryable), "Where",
                   new Type[] { source.ElementType },
                   source.Expression, Expression.Quote(lambda)));
       }
But how to call this functions from specific type ...
public static IQueryable<mytable> Where<mytable>(this IQueryable<mytable> source, string predicate, params object[] values)
please any one help me..
Posted 12-Aug-12 21:36pm
Updated 6-Oct-12 2:33am
v5

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161205.3 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100