Last active
October 11, 2015 09:58
-
-
Save lawrencegripper/2beafe11eef1e024e493 to your computer and use it in GitHub Desktop.
Azure Cache from Cloud Config
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
/// <summary> | |
/// Wrapper for the cache factory to create a DataCache from Authentication token and discovery url | |
/// </summary> | |
/// <param name="token"></param> | |
/// <param name="discoveryurl"></param> | |
/// <returns></returns> | |
private DataCache CacheFactoryWrapper(string token, string discoveryurl) | |
{ | |
DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration(); | |
config.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, discoveryurl); | |
if (!String.IsNullOrEmpty(token)) | |
{ | |
config.SecurityProperties = new DataCacheSecurity(token); | |
} | |
DataCacheFactory cacheFactory = new DataCacheFactory(config); | |
DataCache cache = cacheFactory.GetDefaultCache(); | |
return cache; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment