示例#1
0
 public CacheProfile(int cacheId, string profileName, ICacheEngine engine)
     : this()
 {
     ProfileName = profileName;
     Engine      = engine;
     CacheId     = cacheId;
 }
示例#2
0
 public CacheController(ICacheEngine cacheEngine,
                        ICacheConfiguration cacheConfiguration,
                        IReceptionServiceIssueCache issueCache)
 {
     _cacheEngine        = cacheEngine;
     _cacheConfiguration = cacheConfiguration;
     _issueCache         = issueCache;
 }
示例#3
0
        bool ICacheable.GetFromCache(ICacheEngine cacheEngine, CacheKey cacheKey, out object item)
        {
            T    cachedItem;
            bool found = cacheEngine.Get(cacheKey, out cachedItem);

            item = cachedItem;
            return(found);
        }
示例#4
0
 public CacheProfile(int cacheId, string profileName, ICacheEngine engine, string timeout)
     : this()
 {
     ProfileName = profileName;
     Engine      = engine;
     Timeout     = TimeSpan.Parse(timeout);
     CacheId     = cacheId;
 }
		public void SetCachingEngine(ICacheEngine cacheEngine)
		{
			_cacheEngine = cacheEngine;
			_cacheEngine.AddGroup(new CacheGroupDefinition
			{
				ExpireAfter = TimeSpan.FromMinutes(20),
				Id = "basicSessionManager",
				RollingExpiration = true
			});
		}
示例#6
0
 protected virtual void Remove(ICacheable cacheableItem, CacheProfile cacheProfile, ICacheEngine cacheEngine)
 {
     cacheEngine.Remove(CacheKey.ForProfile(cacheProfile)
                        .WithKey(cacheableItem.CacheItemKey)
                        .Create());
 }
示例#7
0
 public CacheController(ICacheConfiguration cacheConfiguration, ICacheEngine cacheEngine)
 {
     _cacheConfiguration = cacheConfiguration;
     _cacheEngine        = cacheEngine;
 }
示例#8
0
 public WarsAPI(Environment env = Environment.Main, ICacheEngine <Wars> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
示例#9
0
		public void SetCachingEngine(ICacheEngine cacheEngine)
		{
			_cacheEngine = cacheEngine;
			_cacheEngine.AddGroup(new CacheGroupDefinition
			{
				ExpireAfter = TimeSpan.FromDays(1),
				Id = RAZOR_CACHE_ID,
				RollingExpiration = true
			});
		}
示例#10
0
 public ApplicantAPI(Environment env = Environment.Main, ICacheEngine <Applicant> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
 public AlliancesAPI(Environment env = Environment.Main, ICacheEngine <Alliances> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
示例#12
0
 public RedisMemoryHybridCacheEngine(ICacheEngine memoryCache, ICacheEngine redisCache)
 {
     _memoryCacheEngine = memoryCache;
     _redisCacheEngine  = redisCache;
 }
示例#13
0
 public CityAPI(Environment env = Environment.Main, ICacheEngine <City> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
示例#14
0
 public NationMilitaryAPI(Environment env = Environment.Main, ICacheEngine <NationMilitary> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
示例#15
0
 public void SetCacheEngine(ICacheEngine cacheEngine)
 {
     _cacheEngine = cacheEngine;
 }
 public TradePriceAPI(Environment env = Environment.Main, ICacheEngine <TradePrice> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }
        public static IServiceCollection AddCacheInstance <TService, TCacheInstance>(this IServiceCollection services, ICacheEngine cacheEngine, Action <ICacheOptions> setupAction = null)
            where TCacheInstance : CacheInstance, TService, new()
            where TService : class
        {
            var options = new CacheOptions();

            setupAction?.Invoke(options);

            var cacheInstance = Activator.CreateInstance <TCacheInstance>();

            cacheInstance.SetCacheEngine(cacheEngine);
            cacheInstance.SetCacheOptions(options);

            return(services
                   .AddSingleton <TService>(cacheInstance)
                   .AddSingleton <ICacheInstance>(cacheInstance)
                   .AddCacheService());
        }
 public static IServiceCollection AddCacheInstance <TCacheInstance>(this IServiceCollection services, ICacheEngine cacheEngine, Action <ICacheOptions> setupAction = null)
     where TCacheInstance : CacheInstance, new()
 {
     return(services.AddCacheInstance <TCacheInstance, TCacheInstance>(cacheEngine, setupAction));
 }
示例#19
0
		public NodeCacheCoroutine(ICacheEngine nodeCache)
		{
			_nodeCache = nodeCache;
			InstanceName = "NodeCacheCoroutine";

		}
 public UserRepository(IDatabaseEngine databaseEngine, ICacheEngine <int, User> userCacheEngine, bool cacheEnabled)
 {
     _databaseEngine  = databaseEngine;
     _userCacheEngine = userCacheEngine;
     _cacheEnabled    = cacheEnabled;
 }
 public DeviceDBService(string iotHubConnectionString)
 {
     _Cache          = new MemoryCacheEngine();
     _DeviceTwinRepo = new DeviceTwinRepository(iotHubConnectionString);
 }
示例#22
0
 internal void SetCacheEngine(ICacheEngine cacheEngine)
 {
     _cache = cacheEngine;
 }
示例#23
0
 protected virtual void Flush(CacheInvalidationItem item, CacheProfile cacheProfile, ICacheEngine cacheEngine)
 {
     cacheEngine.Clear(cacheProfile, item.CacheItemKey);
 }
 public TradeHistoryAPI(Environment env = Environment.Main, ICacheEngine <TradeHistory> cacheEngine = null) : base(env)
 {
     this._cacheEngine = cacheEngine;
 }