コード例 #1
0
        public DistributedCacheService(IDynamoDBContext dynamoDbContext, ICacheTtlManager cacheTtlManager, IStartUpManager startUpManager, Encoding encoding)
        {
            _dynamoDbContext = dynamoDbContext;

            _cacheTtlManager = cacheTtlManager;

            _encoding = encoding;

            startUpManager.Run(typeof(T).Name);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dynamoDbContext"></param>
        /// <param name="cacheTtlManager"></param>
        /// <param name="startUpManager"></param>
        /// <param name="settings"></param>
        /// <param name="logger"></param>
        public DistributedCacheService(IDynamoDBContext dynamoDbContext,
                                       ICacheTtlManager cacheTtlManager,
                                       IStartUpManager startUpManager,
                                       IDistributedCacheDynamoDbSettings settings,
                                       ILogger <DistributedCacheService <T> > logger)
        {
            _dynamoDbContext = dynamoDbContext;
            _cacheTtlManager = cacheTtlManager;
            _settings        = settings;
            _logger          = logger;

            var tableName = typeof(T).Name;

            if (!string.IsNullOrEmpty(settings.TablePrefix))
            {
                tableName = $"{settings.TablePrefix}{tableName}";
                _logger.LogDebug($"name of caching table are prefixed by {settings.TablePrefix}");
            }

            startUpManager.Run(tableName);
        }