示例#1
0
        public RedisCache(IOptions <RedisCacheOptions> optionsAccessor)
        {
            if (optionsAccessor == null)
            {
                throw new ArgumentNullException(nameof(optionsAccessor));
            }

            _options = optionsAccessor.Value;

            // This allows partitioning a single backend cache for use with multiple apps/services.
            _instance = _options.InstanceName ?? string.Empty;
        }
示例#2
0
 public RedisCache([NotNull] IOptions <RedisCacheOptions> optionsAccessor)
 {
     _options = optionsAccessor.Options;
     // This allows partitioning a single backend cache for use with multiple apps/services.
     _instance = _options.InstanceName ?? string.Empty;
 }