I have two very similar methods:
public IQueryable<User> Find(Func<User, bool> exp)
{
return db.Users.Where(exp);
}
public IQueryable<User> All()
{
return db.Users.Where(x => !x.deleted);
}
The top one, will not compile, saying it returns IEnumerable rather than IQueryable.
Why is this?
Also, I am aware I can add "AsQueryable()" on the end and it will work. What difference does that make though? Any performance hits? I understand that IQueryable has deferred execution and such, will I still get this benefit?