Re: Can I store a C# Class Instance to the Server Cache?



"Joseph Geretz" <jgeretz@xxxxxxxxxx> wrote in message
news:%23Rre6xHUHHA.528@xxxxxxxxxxxxxxxxxxxxxxx
Hi John,

Thanks for your response. I'm not sure what you mean by serializable. Do
you mean that I need to serialize this explicitly into the Cache, or that
the Framework will take care of the serialization for me if the class is
serializable?

Here is that class which I am caching.

internal class SessionCache
{
public string SID;
public string UID;
public string PWD;
public DataTable Profile;
}

I know this is 'working' since I'm able to retrieve this from the cache on
successive Web Method requests. Is this actually being serialized into the
cache for me 'under the hood'? Does it need to be? Do I need to do
anything explicitly to serialize this into the cache?

Joseph, I'm sorry, I wasn't thinking clearly. I was thinking about
ViewState, which _does_ require instances to be serializable. Clearly, the
ASP.NET Cache object doesn't need anything more than your class provides.

John


.



Relevant Pages

  • Re: Can I store a C# Class Instance to the Server Cache?
    ... Server Cache. ... SessionCache class instance involve a thread context switch from 987 to 345? ... public string SID; ... anything explicitly to serialize this into the cache? ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Can I store a C# Class Instance to the Server Cache?
    ... mean that I need to serialize this explicitly into the Cache, ... public string SID; ... I know this is 'working' since I'm able to retrieve this from the cache on ... store VB6 class instances on the server. ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: performance of xml serilisation
    ... them into the ASP.NET cache or session storage, and you'll choose XML ... the first time you use xmlserializer to serialize a class. ...
    (microsoft.public.dotnet.framework.performance)
  • singleton serialization and weblogic - help!
    ... I'm trying to serialize a singleton cache object we're using for our ... Basically I've written a jsp to get the current instance of the cache ...
    (comp.lang.java.programmer)
  • Re: Unable to Serialize
    ... I needed to make the RemoteUserDataBean Serializable (as well as the ... public class RemoteUserServiceService: ... public string employeeId; ... you posted nothing to serialize. ...
    (microsoft.public.dotnet.framework.aspnet)