And if so is there an example in vb .net? I want to add a linq result to the cache and then allow a mvc post to search the cache for better performance…every way I implement it I receive an object not referenced error…
I’m confused, maybe I shouldn’t be doing it this way but the mvc post will be checking up to 2000 records and it would seem best not to have it querying the database everytime.
Thanks for any help…
Yeah. Use
Cache.Insert. I don’t know VB.NET, but here’s some basic advice (see “Caching API, Using the Cache Object”). Just pass your Linq result intoInsert. I would just be careful about not shaping your Linq result with anonymous types, which would make it impossible to properly cast the object when retrieving it from the cache.