Skip to content

Instantly share code, notes, and snippets.

@tncbbthositg
Created June 9, 2009 20:12
Show Gist options
  • Save tncbbthositg/126757 to your computer and use it in GitHub Desktop.
Save tncbbthositg/126757 to your computer and use it in GitHub Desktop.
public class DictionaryCache<TObject>
{
// hide the constructor
private DictionaryCache() { }
public static Dictionary<string, TObject> Cache
{
get
{
return Session[CacheType.Name] as Dictionary<string, TObject>;
}
set
{
Session[CacheType.Name] = value;
}
}
private static Type CacheType { get { return typeof(TObject); } }
private static HttpSessionState Session { get { return HttpContext.Current.Session; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment