Created
April 22, 2013 18:37
-
-
Save srkirkland/5437393 to your computer and use it in GitHub Desktop.
Singleton for creating a cache factory for Azure Caching. Creates the DataCacheFactory only once and stores it in CacheFactory.Instance. Can then get a desired DataCache by calling CacheFactory.Instance.GetCache("CacheName");
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CacheFactory | |
{ | |
/// <summary> | |
/// This is a thread-safe, lazy singleton. See http://www.yoda.arachsys.com/csharp/singleton.html | |
/// for more details about its implementation. | |
/// </summary> | |
public static DataCacheFactory Instance | |
{ | |
get { return Nested.CacheFactory; } | |
} | |
private class Nested | |
{ | |
internal static readonly DataCacheFactory CacheFactory = new DataCacheFactory(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment