public AzureCacheClient(string cacheName = null, string endpointUrl = null, string authorizationToken = null, bool useLocalCache = true) { if (!String.IsNullOrEmpty(endpointUrl) && !String.IsNullOrEmpty(authorizationToken)) { var config = new DataCacheFactoryConfiguration { AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, endpointUrl), SecurityProperties = new DataCacheSecurity(authorizationToken, false) }; if (useLocalCache) { config.LocalCacheProperties = new DataCacheLocalCacheProperties(10000, TimeSpan.FromMinutes(5), DataCacheLocalCacheInvalidationPolicy.TimeoutBased); } CacheFactory = new DataCacheFactory(config); } else { CacheFactory = new DataCacheFactory(); } if (string.IsNullOrEmpty(cacheName)) { DataCache = CacheFactory.GetDefaultCache(); } else { DataCache = CacheFactory.GetCache(cacheName); } }