Syntax to change the value of a cached object property
In an ASP.NET 3.5 VB web app, I successfully manage to cache an object containing several personal details such as name, address, etc. One of the items is CreditNum which I'd like to change in the cache on the fly. Is there a way to access this directly in the cache or do I have to destroy and rebuild the whole object just to change the value of objMemberDetails.CreditNum?
The cache is set using:
Public Shared Sub CacheSet(ByVal key As String, ByVal value As Object)
Dim userID As String = HttpContext.Current.User.Ident开发者_如何学City.Name
HttpContext.Current.Cache(key & "_" & userID) = value
End Sub
Besides that this answer might help; Cache is really there to help you add, read, and drop the objects that your app requires frequently.
精彩评论