private static IncrementTag OpValueToIncrementTag(object opvalue) { if (opvalue is IncrementTag) { return((IncrementTag)opvalue); } if (opvalue is ulong) { return new IncrementTag { Delta = (ulong)opvalue, DefaultValue = 0 } } ; if (opvalue is long) { return new IncrementTag { Delta = (ulong)opvalue, DefaultValue = 0 } } ; if (opvalue is int) { return new IncrementTag { Delta = (ulong)opvalue, DefaultValue = 0 } } ; throw new ArgumentOutOfRangeException("opvalue"); } Action <IServiceLocator, string> ServiceCacheManager.ISetupRegistration.DefaultServiceRegistrar { get { return((locator, name) => ServiceCacheManager.RegisterInstance <IMemcachedServiceCache>(this, locator, name)); } }
public void Constructor() { // set service cache provider from app.config ServiceCacheManager.SetProvider(() => new MemcachedServiceCache()); // set service cache provider from a IMemcachedClientConfiguration var configuration = new MemcachedClientConfiguration(); configuration.AddServer("serveraddress", 11211); ServiceCacheManager.SetProvider(() => new MemcachedServiceCache(configuration)); // set service cache provider from an existing MemcachedClient var memcachedClient = new MemcachedClient(); ServiceCacheManager.SetProvider(() => new MemcachedServiceCache(memcachedClient)); }
static MemcachedServiceCache() { ServiceCacheManager.EnsureRegistration(); }
static ServerAppFabricServiceCache() { ServiceCacheManager.EnsureRegistration(); }
static WebServiceCache() { ServiceCacheManager.EnsureRegistration(); }
static SystemServiceCache() { ServiceCacheManager.EnsureRegistration(); }