How about adding TryGetValue to the Cache?

Topics: Caching Application Block
Jun 8, 2007 at 9:34 PM
I am currently trying to use the CacheManager and have been spoiled by the new generic collections having the TryGetValue method. Since null is a valid value for items I'm adding to the cache, I can't tell if the key I just check for returned the value from the cache or that the key doesn't exist in the cache. I have to check Contains to make sure.
Jun 9, 2007 at 4:08 PM
I doubt you will see any new functionality added to the Caching Application Block unless there is a lot of demand.

I think this is where the EntLibContrib Project can come in very handy. One could add some functionality and check it into EntLibContrib where others could help with development and maintenance. One could add TryGetValue Functionality, Enumerating of a Cache, a new provider that wraps System.Web.Caching, etc.

I recommend looking into EntLibContrib which is for these various ideas.

Regards,

Dave

______________________________

David Hayden
Microsoft MVP C#