/// <summary>
 /// Returns a Polly <see cref="IAsyncCacheProvider{TCache}"/> wrapping a given <see cref="Microsoft.Extensions.Caching.Distributed.IDistributedCache"/>, where TCache is byte[].
 /// </summary>
 /// <param name="iDistributedCache">The <see cref="Microsoft.Extensions.Caching.Distributed.IDistributedCache"/> instance to use.</param>
 /// <returns>A corresponding Polly <see cref="IAsyncCacheProvider{TCache}"/>.</returns>
 public static IAsyncCacheProvider <TCache> AsAsyncCacheProvider <TCache>(this Microsoft.Extensions.Caching.Distributed.IDistributedCache iDistributedCache)
 {
     if (typeof(TCache) == typeof(byte[]))
     {
         return((IAsyncCacheProvider <TCache>) new NetStandardIDistributedCacheByteArrayProvider(iDistributedCache));
     }
     else if (typeof(TCache) == typeof(string))
     {
         return((IAsyncCacheProvider <TCache>) new NetStandardIDistributedCacheStringProvider(iDistributedCache));
     }
     else
     {
         throw new ArgumentException($"{nameof(TCache)} must be either {typeof(string).Name} or {typeof(byte).Name}[]", nameof(TCache));
     }
 }
示例#2
0
 public DistributedSessionStore(Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)
 {
 }
示例#3
0
 public DistributedSession(Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string sessionKey, System.TimeSpan idleTimeout, System.TimeSpan ioTimeout, System.Func <bool> tryEstablishSession, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool isNewSessionKey)
 {
 }
 public static System.Threading.Tasks.Task SetStringAsync(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
 {
     throw null;
 }
 public static void SetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options)
 {
 }
 public static void Set(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value)
 {
 }
 public static string GetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key)
 {
     throw null;
 }
示例#8
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime appLifetime, Microsoft.Extensions.Caching.Distributed.IDistributedCache cache)
        {
            loggerFactory.AddSerilog();
            app.EnableBuffering(8 << 20);
            app.UseMvc();

            appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
        }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NetStandardIDistributedCacheByteArrayProvider"/> class.
 /// </summary>
 /// <param name="iDistributedCache">An IDistributedCache implementation with which to store cached items.</param>
 public NetStandardIDistributedCacheByteArrayProvider(Microsoft.Extensions.Caching.Distributed.IDistributedCache iDistributedCache) : base(iDistributedCache)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NetStandardIDistributedCacheByteArrayProvider"/> class.
 /// </summary>
 /// <param name="iDistributedCache">An IDistributedCache implementation with which to store cached items.</param>
 protected NetStandardIDistributedCacheProvider(
     Microsoft.Extensions.Caching.Distributed.IDistributedCache iDistributedCache)
 {
     _cache = iDistributedCache ?? throw new ArgumentNullException(nameof(iDistributedCache));
 }
示例#11
0
 public AlarmMessageHub(IAlarmStatusAppService alarmStatusAppService, IHubContext <AlarmMessageHub> hubContext, Microsoft.Extensions.Caching.Distributed.IDistributedCache cache)
 {
     _alarmStatusAppService = alarmStatusAppService;
     _hubContext            = hubContext;
     _cache = cache;
 }
示例#12
0
 public SandBoxDataAccessor(CommonDbContext _ShopDbContext, Microsoft.Extensions.Caching.Distributed.IDistributedCache _DistributedCache) : base(_ShopDbContext, _DistributedCache)
 {
 }
示例#13
0
 public StoreMapInfoAccessor(CommonDbContext _ShopDbContext,
                             Microsoft.Extensions.Caching.Distributed.IDistributedCache _DistributedCache)
     : base(_ShopDbContext, _DistributedCache)
 {
 }