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 RedisConfig OverrideSerializationService <TSerializationServiceType>() where TSerializationServiceType : IRedisSerializationService { var type = TypeOf.New <IRedisSerializationService, TSerializationServiceType>(); OverrideSerializationService(type); return(this); }
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 OAuthConfig RegisterTokenService <TTokenService>() where TTokenService : class, ITokenService { RegisterTokenService(TypeOf.New <ITokenService, TTokenService>()); return(this); }