I\'m currently trying out the new MemoryCache
in .Net 4 to cache a few bits of data in one of our apps. The trouble I have is the objects are updated and the ca
You can do it easier if you deserialize and serialize again and get your cache object "By Value".
You can do it like this with Newtonsoft lib (just get it from NuGet)
var cacheObj = HttpRuntime.Cache.Get(CACHEKEY);
var json = JsonConvert.SerializeObject(cacheObj);
var byValueObj = JsonConvert.DeserializeObject>(json);
return byValueObj;