Execute LINQ query on list with unknown elements type
LINQ
1
Posts
1
Posters
1
Views
1
Watching
-
Hello. How is it possible to execute expression on list if it is unknown which type of elements this list contains.
Expression ex = Expression.OrElse(exp1,exp2);
//Expression<Func<DataSrc, bool>> lambda1 =
//Expression.Lambda<Func<DataSrc, bool>>(ex, new ParameterExpression[] { pe });Expression lambda = Expression.Lambda(ex, new ParameterExpression[] { pe });
///How may i rewrite this two lines below if list's element type unknown
//Func<<DataSrc, bool>> func = lambda1.Compile();
//var r = list.Where(func);
Could you suggest me some sources (articles, links) which explain how to build and work with dynamicaly builded LINQ expressions. Thank
---------- ----------