There is no implicit conversion from a method group to an Expression
(of a corresponding delegate type). There is an implicit conversion from a method group to a delegate of a matching signature. Therefore only the IEnumerable
overload matches.
Of course, that's not to say that you need to use a lambda. Just write:
ctx.Set<Person>().AsExpandable().Where(ByName);
Since you're passing in an expression (ByName
is, after all, an Expression<Person, bool>
already, which is exactly what Queryable.Where<Person>
requires) this will evaluate as a query, not in linq to objects.