How can we compare Expression<Func<T, bool>>
with T
in Entity Framework?
For example:
Expression<Func<Book, bool>> exp = getYellowBooksExpr();
var v = context.Books.Where(exp).ToList();
This above code would run well, but how can we run a query like this:
var v = context.Students.Where(x => x.Book == exp).ToList();