IQueryable ではなく IEnumerable を返すようです。
メソッドのパラメーター:Func<Cat, bool> predicate
コード:
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);
}
の代わりに が.Where
返されるため、これはコンパイルされません。私はできることは知っていますが、それはそれを適切なものとして扱わないのではないかと思います。IEnumerable
IQueryable
.AsQueryable
IQueryable
これに対する簡単な修正はありますか?