I am trying to create an expression tree which will look through my table called test for all strings 'email' in column Foo. I pretty much copied this from the msdn with some small changes and cannot get it to search through my table. Any help getting this expression tree to search would be great. THANK YOU very much
Table Structure called Test
id int
foo char(10)
Error
No generic method 'Where' on type 'System.Linq.Queryable' is compatible with the supplied type arguments
var s = new m2Entities().Test
var queryableData = new m2Entities().SaleLogs.AsQueryable<SaleLog>();
ParameterExpression pe = Expression.Parameter(typeof(string), "foo");
Expression left = Expression.Call(pe, typeof(string).GetMethod("ToLower", System.Type.EmptyTypes));
Expression right = Expression.Constant("bar");
Expression e1 = Expression.Equal(left, right);
MethodCallExpression whereCallExpression = Expression.Call(typeof(Queryable),
"Where",
new Type[] { queryableData.ElementType },
queryableData.Expression,
Expression.Lambda<Func<string, bool >>(e1,new ParameterExpression[] { pe }));
var results = queryableData.Provider.CreateQuery<string>(whereCallExpression);