How to use an Expression<Func<Model, bool>> in a Linq to EF where condition?
问题 There have already been some questions about this topic (for instance Expression.Invoke in Entity Framework?), however, I could not find an answer for my specific situation. I would like to define a method like this: public IQueryable<Customer> GetCustomers(Expression<Func<Customer, bool>> condition) { return from p in ctx.Customers.AsExpandable() where condition.Compile()(p) select p; } The AsExpandable method is from LinqKit (as it was adviced in the thread mentioned before). However, when