60 instantiations of DistributedCacheEntryOptions
Microsoft.AspNetCore.Mvc.TagHelpers (1)
DistributedCacheTagHelper.cs (1)
80var options = new DistributedCacheEntryOptions();
Microsoft.AspNetCore.Session (1)
DistributedSession.cs (1)
282new DistributedCacheEntryOptions().SetSlidingExpiration(_idleTimeout),
Microsoft.Extensions.Caching.Abstractions (5)
DistributedCacheExtensions.cs (4)
28cache.Set(key, value, new DistributedCacheEntryOptions()); 45return cache.SetAsync(key, value, new DistributedCacheEntryOptions(), token); 57cache.SetString(key, value, new DistributedCacheEntryOptions()); 87return cache.SetStringAsync(key, value, new DistributedCacheEntryOptions(), token);
Hybrid\HybridCacheEntryOptions.cs (1)
36=> Expiration is null ? null : (_dc ??= new() { AbsoluteExpirationRelativeToNow = Expiration });
Microsoft.Extensions.Caching.Hybrid (2)
Internal\DefaultHybridCache.cs (1)
104_defaultDistributedCacheExpiration = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = _defaultExpiration };
Internal\DefaultHybridCache.L2.cs (1)
164=> new() { AbsoluteExpirationRelativeToNow = options.Expiration };
Microsoft.Extensions.Caching.Hybrid.Tests (1)
DistributedCacheTests.cs (1)
394= new() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5) };
Microsoft.Extensions.Caching.MicroBenchmarks (1)
DistributedCacheBenchmarks.cs (1)
105var options = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30) };
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCache.cs (1)
289options = new DistributedCacheEntryOptions()
Microsoft.Extensions.Caching.SqlServer.Tests (22)
SqlServerCacheWithDatabaseTest.cs (22)
86new DistributedCacheEntryOptions().SetAbsoluteExpiration(testClock.UtcNow.AddHours(-1))); 105new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(30))); 132await cache.SetAsync(key, expectedValue, new DistributedCacheEntryOptions() 173await cache.SetAsync(key, expectedValue, new DistributedCacheEntryOptions() 214new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(30))); 236new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(slidingExpirationWindow))); 264new DistributedCacheEntryOptions().SetSlidingExpiration(slidingExpirationWindow)); 296new DistributedCacheEntryOptions() 319new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromSeconds(10))); 342new DistributedCacheEntryOptions() 371new DistributedCacheEntryOptions() 399new DistributedCacheEntryOptions() 428new DistributedCacheEntryOptions().SetAbsoluteExpiration(absoluteExpiration)); 442new DistributedCacheEntryOptions().SetAbsoluteExpiration(absoluteExpiration)); 468new DistributedCacheEntryOptions().SetAbsoluteExpiration(absoluteExpiration)); 495new DistributedCacheEntryOptions().SetSlidingExpiration(slidingExpiration)); 526new DistributedCacheEntryOptions() 581new DistributedCacheEntryOptions().SetAbsoluteExpiration(absoluteExpirationRelativeToNow)); 612new DistributedCacheEntryOptions().SetSlidingExpiration(slidingExpiration)); 637new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromHours(1))); 657new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromHours(1))); 677new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(10)));
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (26)
TimeExpirationAsyncTests.cs (13)
48await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(expected)); 62await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 83await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 98await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(-1))); 114await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.Zero)); 128await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 148await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 163await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(-1))); 176await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.Zero)); 190await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 208await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(0.25))); 221await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 246await cache.SetAsync(key, value, new DistributedCacheEntryOptions()
TimeExpirationTests.cs (13)
31cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(expected)); 45cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 66cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 81cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(-1))); 98cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.Zero)); 112cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 132cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 147cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(-1))); 161cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.Zero)); 175cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 193cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(0.25))); 206cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 231cache.Set(key, value, new DistributedCacheEntryOptions()
79 references to DistributedCacheEntryOptions
Microsoft.AspNetCore.Mvc.TagHelpers (7)
Cache\DistributedCacheTagHelperService.cs (1)
65public async Task<IHtmlContent> ProcessContentAsync(TagHelperOutput output, CacheTagKey key, DistributedCacheEntryOptions options)
Cache\DistributedCacheTagHelperStorage.cs (1)
34public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options)
Cache\IDistributedCacheTagHelperService.cs (2)
21/// <param name="options">The <see cref="DistributedCacheEntryOptions"/>.</param> 23Task<IHtmlContent> ProcessContentAsync(TagHelperOutput output, CacheTagKey key, DistributedCacheEntryOptions options);
Cache\IDistributedCacheTagHelperStorage.cs (1)
28Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options);
DistributedCacheTagHelper.cs (2)
77internal DistributedCacheEntryOptions GetDistributedCacheEntryOptions() 80var options = new DistributedCacheEntryOptions();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (8)
DistributedCacheTagHelperTest.cs (8)
39/*options*/ It.IsAny<DistributedCacheEntryOptions>())); 67/*options*/ It.IsAny<DistributedCacheEntryOptions>()), 81/*options*/ It.IsAny<DistributedCacheEntryOptions>())); 119/*options*/ It.IsAny<DistributedCacheEntryOptions>()), 264var cacheEntryOptions = cacheTagHelper.GetDistributedCacheEntryOptions(); 287var cacheEntryOptions = cacheTagHelper.GetDistributedCacheEntryOptions(); 313var cacheEntryOptions = cacheTagHelper.GetDistributedCacheEntryOptions(); 339var cacheEntryOptions = cacheTagHelper.GetDistributedCacheEntryOptions();
Microsoft.AspNetCore.Session.Tests (2)
SessionTests.cs (2)
1204public void Set(string key, byte[] value, DistributedCacheEntryOptions options) => _cache.Set(key, value, options); 1206public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default)
Microsoft.Extensions.Caching.Abstractions (17)
DistributedCacheEntryExtensions.cs (7)
9/// Provides extension methods for <see cref="DistributedCacheEntryOptions"/> operations. 18public static DistributedCacheEntryOptions SetAbsoluteExpiration( 19this DistributedCacheEntryOptions options, 31public static DistributedCacheEntryOptions SetAbsoluteExpiration( 32this DistributedCacheEntryOptions options, 45public static DistributedCacheEntryOptions SetSlidingExpiration( 46this DistributedCacheEntryOptions options,
DistributedCacheExtensions.cs (2)
68public static void SetString(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options) 100public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
Hybrid\HybridCacheEntryOptions.cs (2)
34private DistributedCacheEntryOptions? _dc; 35internal DistributedCacheEntryOptions? ToDistributedCacheEntryOptions()
IBufferDistributedCache.cs (4)
40/// <remarks>This method is functionally similar to <see cref="IDistributedCache.Set(string, byte[], DistributedCacheEntryOptions)"/>, but avoids the array allocation.</remarks> 41void Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options); 50/// <remarks>This method is functionally similar to <see cref="IDistributedCache.SetAsync(string, byte[], DistributedCacheEntryOptions, CancellationToken)"/>, but avoids the array allocation.</remarks> 51ValueTask SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default);
IDistributedCache.cs (2)
35void Set(string key, byte[] value, DistributedCacheEntryOptions options); 45Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));
Microsoft.Extensions.Caching.Hybrid (4)
Internal\DefaultHybridCache.cs (1)
41private readonly DistributedCacheEntryOptions _defaultDistributedCacheExpiration;
Internal\DefaultHybridCache.L2.cs (3)
147private DistributedCacheEntryOptions GetOptions(HybridCacheEntryOptions? options) 149DistributedCacheEntryOptions? result = null; 163static DistributedCacheEntryOptions ToDistributedCacheEntryOptions(HybridCacheEntryOptions options)
Microsoft.Extensions.Caching.Hybrid.Tests (9)
BufferReleaseTests.cs (2)
85void IBufferDistributedCache.Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options) 88ValueTask IBufferDistributedCache.SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token)
DistributedCacheTests.cs (1)
393private static readonly DistributedCacheEntryOptions _fiveMinutes
L2Tests.cs (4)
164void IBufferDistributedCache.Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options) 171ValueTask IBufferDistributedCache.SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token) 258void IDistributedCache.Set(string key, byte[] value, DistributedCacheEntryOptions options) 265Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token)
StampedeTests.cs (2)
55void IDistributedCache.Set(string key, byte[] value, DistributedCacheEntryOptions options) => throw new NotSupportedException("Intentionally not provided"); 57Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => throw new NotSupportedException("Intentionally not provided");
Microsoft.Extensions.Caching.Memory (2)
MemoryDistributedCache.cs (2)
72public void Set(string key, byte[] value, DistributedCacheEntryOptions options) 95public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
Microsoft.Extensions.Caching.MicroBenchmarks (1)
DistributedCacheBenchmarks.cs (1)
105var options = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30) };
Microsoft.Extensions.Caching.SqlServer (10)
DatabaseOperations.cs (3)
131public void SetCacheItem(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options) 169public async Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)) 371private static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset utcNow, DistributedCacheEntryOptions options)
IDatabaseOperations.cs (2)
30void SetCacheItem(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options); 32Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));
SqlServerCache.cs (5)
169public void Set(string key, byte[] value, DistributedCacheEntryOptions options) 182void IBufferDistributedCache.Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options) 199DistributedCacheEntryOptions options, 218DistributedCacheEntryOptions options, 283private void GetOptions(ref DistributedCacheEntryOptions options)
Microsoft.Extensions.Caching.StackExchangeRedis (9)
RedisCache.cs (9)
153public void Set(string key, byte[] value, DistributedCacheEntryOptions options) 156void IBufferDistributedCache.Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options) 159private void SetImpl(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options) 200public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default) 203ValueTask IBufferDistributedCache.SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token) 206private async Task SetImplAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default) 569private static long? GetExpirationInSeconds(DateTimeOffset creationTime, DateTimeOffset? absoluteExpiration, DistributedCacheEntryOptions options) 588private static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset creationTime, DistributedCacheEntryOptions options) 594nameof(DistributedCacheEntryOptions.AbsoluteExpiration),
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (10)
TimeExpirationAsyncTests.cs (5)
50nameof(DistributedCacheEntryOptions.AbsoluteExpiration), 100nameof(DistributedCacheEntryOptions.AbsoluteExpirationRelativeToNow), 116nameof(DistributedCacheEntryOptions.AbsoluteExpirationRelativeToNow), 164}, nameof(DistributedCacheEntryOptions.SlidingExpiration), "The sliding expiration value must be positive.", TimeSpan.FromMinutes(-1)); 178nameof(DistributedCacheEntryOptions.SlidingExpiration),
TimeExpirationTests.cs (5)
33nameof(DistributedCacheEntryOptions.AbsoluteExpiration), 83nameof(DistributedCacheEntryOptions.AbsoluteExpirationRelativeToNow), 100nameof(DistributedCacheEntryOptions.AbsoluteExpirationRelativeToNow), 148}, nameof(DistributedCacheEntryOptions.SlidingExpiration), "The sliding expiration value must be positive.", TimeSpan.FromMinutes(-1)); 163nameof(DistributedCacheEntryOptions.SlidingExpiration),