Reputation: 13756
can this be cached?
Upvotes: 1
Views: 246
Reputation: 74802
No, you would need to enumerate it (e.g. using ToList()) and cache the results of the enumeration. Caching the IQueryable object itself is effectively just caching the query: in that scenario it will still be re-executed every time you try to use the results.
Upvotes: 3