It appears to return IEnumerable rather than IQueryable:
method parameter: Func<Cat, bool> predicate
code:
var allCats = _catEntities.GetCats(); // IQueryable
if (skip.HasValue) allCats = allCats .Skip(skip.Value);
if (take.HasValue) allCats = allCats .Take(take.Value);
if (predicate != null)
{
allCats = allCats.Where(predicate);
}
This doesn't compile because .Where
returns IEnumerable
instead of IQueryable
. I know I can do .AsQueryable
or whatever but I suspect that won't treat it as a proper IQueryable
.
Is there a simple fix for this?