Syntax to change the value of a cached object property

Posted by Craig on Stack Overflow See other posts from Stack Overflow or by Craig
Published on 2010-06-06T19:14:54Z Indexed on 2010/06/06 19:52 UTC
Read the original article Hit count: 337

Filed under:
|
|

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.Identity.Name
HttpContext.Current.Cache(key & "_" & userID) = value
End Sub

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about cache