I need to build up a List<object>
and cache the list and be able to append to it. I also need to be able to blow it away easily and recreate it. What is a simple way to accomplish this?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
This Tutorial is what I found to be helpful
Here is a sample
Something like this perhaps?
As for how to use.....
The caching parts of "Tracing and Caching Provider Wrappers for Entity Framework", while not simple, are still a pretty good review of some useful things to think about with caching.
Specifically, the two classes
InMemoryCache
andAspNetCache
and their associated tests:Similar to what the question did, you could wrap
HttpRuntime.Cache
orHttpContext.Current.Items
orHttpContext.Current.Cache
in an implementation ofICache
.