I have a method which accepts a linq query:
public IEnumerable<User> GetAll(System.Linq.Expressions.Expression<Func<UserDTO, bool>> query)
{
return GetAllDTO(query);
}
What I would like to be able to do is append an additional WHERE clause to this existing query so it looks something like this:
public IEnumerable<User> GetAll(System.Linq.Expressions.Expression<Func<UserDTO, bool>> query)
{
return GetAllDTO(query).Where(x => x.Organisation == "something")
}
But this will load ALL the records and that match the query and THEN apply the where clause. I want to add the where clause to the original query so that only the records matching both are returned.