Example #1
0
        public static CacheModuleConfig AddQueryCache(this CacheModuleConfig cacheModuleConfig, Action <QueryCacheModuleConfig> configureDelegate = null)
        {
            var module = cacheModuleConfig.AttachCacheExtension(() => new QueryCacheModule(new QueryCacheModuleConfig()));

            configureDelegate?.Invoke(module.Config);

            return(cacheModuleConfig);
        }
Example #2
0
 public static CacheModuleConfig AddMemoryCacheStorage(this CacheModuleConfig cacheModuleConfig, Action <CacheLayerOptions> configureDelegate)
 {
     cacheModuleConfig.AddCacheLayer(() => new MemoryCacheModule(new CacheLayerDefinition()), definition =>
     {
         definition.CacheServiceType = TypeOf.New <ICacheService, IMemoryCacheService>();
         configureDelegate?.Invoke(definition.Options);
     });
     return(cacheModuleConfig);
 }
Example #3
0
        public static CacheModuleConfig AddCacheLayerLogging(this CacheModuleConfig cacheModuleConfig)
        {
            cacheModuleConfig.SetFirstCacheLayer(() => new PreLoggingCacheModule(new CacheLayerDefinition()), definition =>
            {
                definition.CacheServiceType = TypeOf.New <ICacheService, PreLoggingCacheService>();
            });

            cacheModuleConfig.SetLastCacheLayer(() => new PostLoggingCacheModule(new CacheLayerDefinition()), definition =>
            {
                definition.CacheServiceType = TypeOf.New <ICacheService, PostLoggingCacheService>();
            });

            return(cacheModuleConfig);
        }
Example #4
0
 public CacheServiceProvider(CacheModuleConfig config, ICacheLayerCacheServiceFactory cacheLayerCacheServiceFactory)
 {
     _config = config;
     _cacheLayerCacheServiceFactory = cacheLayerCacheServiceFactory;
 }