The lambda expression that you write within Where
is actually evaluated and translated to SQL by EF. For example when you write
db.Pages.Where(x => x.Title == "Hello")
EF knows to translate the resulting IQueryable<T>
to something like:
SELECT ... FROM Pages WHERE title = 'Hello'
Similarly, it knows about some of the common methods and operators, for example:
db.Pages.Where(x => x.Contains("Hello"))
EF knows to translate String.Contains
to:
SELECT ... FROM Pages WHERE title LIKE '%Hello%'
However, when you use your own custom methods with the expression, then EF does not know how to translate that custom method to SQL, which is what it complains about in the error message you saw.