G
Guest
I have an object that I am using in my ASP.net app. I only want one instance of this object available to all of my pages.
Here is a sample
public class statictes
private statictest() {} // static onl
private static string data = null
public static string Dat
ge
if(data != null) return data
data = "INIT"
return data
se
data = value
I am assuming that this private static member will no be garbage collected as long as the application is running. Is this correct? Would it be better to store it in cache (I should not expire until application end, and it does not have any dependencies)
Thank
Here is a sample
public class statictes
private statictest() {} // static onl
private static string data = null
public static string Dat
ge
if(data != null) return data
data = "INIT"
return data
se
data = value
I am assuming that this private static member will no be garbage collected as long as the application is running. Is this correct? Would it be better to store it in cache (I should not expire until application end, and it does not have any dependencies)
Thank