Пример #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);
 }
Пример #2
0
        public RedisConfig OverrideSerializationService <TSerializationServiceType>()

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

            OverrideSerializationService(type);
            return(this);
        }
Пример #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);
        }
Пример #4
0
 public OAuthConfig RegisterTokenService <TTokenService>()
     where TTokenService : class, ITokenService
 {
     RegisterTokenService(TypeOf.New <ITokenService, TTokenService>());
     return(this);
 }