Exemplo n.º 1
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);
 }
Exemplo n.º 2
0
        public RedisConfig OverrideSerializationService <TSerializationServiceType>()

            where TSerializationServiceType : IRedisSerializationService
        {
            var type = TypeOf.New <IRedisSerializationService, TSerializationServiceType>();

            OverrideSerializationService(type);
            return(this);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public OAuthConfig RegisterTokenService <TTokenService>()
     where TTokenService : class, ITokenService
 {
     RegisterTokenService(TypeOf.New <ITokenService, TTokenService>());
     return(this);
 }