/// <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)); } }
public DistributedSessionStore(Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { }
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; }
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(); } }
/// <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)); }
public AlarmMessageHub(IAlarmStatusAppService alarmStatusAppService, IHubContext <AlarmMessageHub> hubContext, Microsoft.Extensions.Caching.Distributed.IDistributedCache cache) { _alarmStatusAppService = alarmStatusAppService; _hubContext = hubContext; _cache = cache; }
public SandBoxDataAccessor(CommonDbContext _ShopDbContext, Microsoft.Extensions.Caching.Distributed.IDistributedCache _DistributedCache) : base(_ShopDbContext, _DistributedCache) { }
public StoreMapInfoAccessor(CommonDbContext _ShopDbContext, Microsoft.Extensions.Caching.Distributed.IDistributedCache _DistributedCache) : base(_ShopDbContext, _DistributedCache) { }