コード例 #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="DistributedCacheManager"/>
 /// </summary>
 /// <param name="distributedCache">An instance of an object that represent distributed cache</param>
 /// <param name="cacheOptions">The settings of the cache</param>
 public DistributedCacheManager(IDistributedCache distributedCache, IOptions <DeliveryCacheOptions> cacheOptions)
 {
     _distributedCache = distributedCache ?? throw new ArgumentNullException(nameof(distributedCache));
     _cacheOptions     = cacheOptions.Value ?? new DeliveryCacheOptions();
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="MemoryCacheManager"/>
 /// </summary>
 /// <param name="memoryCache">An instance of an object that represent memory cache</param>
 /// <param name="cacheOptions">The settings of the cache</param>
 public MemoryCacheManager(IMemoryCache memoryCache, IOptions <DeliveryCacheOptions> cacheOptions)
 {
     _memoryCache  = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
     _cacheOptions = cacheOptions.Value ?? new DeliveryCacheOptions();
 }
 /// <summary>
 /// Initializes a new instance of <see cref="DeliveryCacheManager"/>
 /// </summary>
 /// <param name="memoryCache">An instance of an object that represent memory cache</param>
 /// <param name="cacheOptions">The settings of the cache</param>
 public DeliveryCacheManager(IMemoryCache memoryCache, IOptions <DeliveryCacheOptions> cacheOptions)
 {
     _memoryCache  = memoryCache;
     _cacheOptions = cacheOptions.Value ?? new DeliveryCacheOptions();
 }