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); }
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); }
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); }
public CacheServiceProvider(CacheModuleConfig config, ICacheLayerCacheServiceFactory cacheLayerCacheServiceFactory) { _config = config; _cacheLayerCacheServiceFactory = cacheLayerCacheServiceFactory; }