protected virtual void Init(ICacheSetting setting) { this.cacheName = setting.Name; string storageTypeName = null; if (setting.CacheStorage != null) { storageTypeName = setting.CacheStorage.TypeName; } this.CacheStorage = this.ObjectService.GetOrCreateObject <ICacheStorage>(storageTypeName); this.Interval = setting.Interval; }
void IInitializable <ICacheSetting> .Init(ICacheSetting setting) { this.CacheName = setting.Name; string serializerName = null; var st = setting.ConfigSetting.ToSetting <CacheSetting>("memcached"); if (st != null) { serializerName = st.SerializerName; } var serializerFactory = ObjectService.GetObject <ISerializerFactory>(); if (!string.IsNullOrEmpty(serializerName)) { this.Serializer = serializerFactory.GetSerializer(serializerName); } if (this.Serializer == null) { this.Serializer = serializerFactory.Default; } this.InitInternal(st); }
public CacheWrapper(IDistributedCache distributedCache, ICacheSetting cacheSetting) { DistributedCache = distributedCache; CacheSetting = cacheSetting; }
protected AsyncCacheRepositoryBase(ICacheSetting cacheSettings) { _cacheSettings = cacheSettings; }
void IInitializable <ICacheSetting> .Init(ICacheSetting setting) { this.Init(setting); }