zsharp
zsharp

Reputation: 13756

Can I data cache an IQueryable<> collection?

can this be cached?

Upvotes: 1

Views: 246

Answers (1)

itowlson
itowlson

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

Related Questions