6 implementations of GetAsync
Microsoft.AspNetCore.Session.Tests (1)
SessionTests.cs (1)
1170public Task<byte[]> GetAsync(string key, CancellationToken token = default)
Microsoft.Extensions.Caching.Hybrid.Tests (2)
L2Tests.cs (1)
223Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token)
StampedeTests.cs (1)
43Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided");
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
59public Task<byte[]?> GetAsync(string key, CancellationToken token = default(CancellationToken))
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCache.cs (1)
99public async Task<byte[]?> GetAsync(string key, CancellationToken token = default(CancellationToken))
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCache.cs (1)
120public async Task<byte[]?> GetAsync(string key, CancellationToken token = default)
45 references to GetAsync
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
DistributedCacheConformanceTests.cs (1)
63await cache.GetAsync("myFakeKey", CancellationToken.None);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Cache\DistributedCacheTagHelperStorage.cs (1)
30return _distributedCache.GetAsync(key);
Microsoft.AspNetCore.Session (2)
DistributedSession.cs (2)
222var data = await _cache.GetAsync(_sessionKey, cts.Token); 258var data = await _cache.GetAsync(_sessionKey, cts.Token);
Microsoft.Extensions.Caching.Abstractions (2)
DistributedCacheExtensions.cs (1)
133byte[]? data = await cache.GetAsync(key, token).ConfigureAwait(false);
IBufferDistributedCache.cs (1)
31/// <remarks>This method is functionally similar to <see cref="IDistributedCache.GetAsync(string, CancellationToken)"/>, but avoids the array allocation.</remarks>
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.L2.cs (1)
24var pendingLegacy = _backendCache!.GetAsync(key, token);
Microsoft.Extensions.Caching.Hybrid.Tests (4)
DistributedCacheTests.cs (4)
121var actual = await cache.GetAsync(key); 129actual = await cache.GetAsync(key); 134actual = await cache.GetAsync(key); 243Assert.Null(await cache.GetAsync(key));
Microsoft.Extensions.Caching.MicroBenchmarks (6)
DistributedCacheBenchmarks.cs (6)
130Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 150total += (await _backend.GetAsync(RandomKey()))?.Length ?? 0; 158Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 185Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey()); 204total += (await _backend.GetAsync(FixedKey()))?.Length ?? 0; 212Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey());
Microsoft.Extensions.Caching.SqlServer.Tests (9)
SqlServerCacheWithDatabaseTest.cs (9)
64var value = await cache.GetAsync("NonExisting"); 242var value = await cache.GetAsync(key); 302var value = await cache.GetAsync(key); 325var value = await cache.GetAsync(key); 349var value = await cache.GetAsync(key); 585var value = await cache.GetAsync(key); 640var value = await cache.GetAsync(key.ToUpper(CultureInfo.InvariantCulture)); // key made upper case 660var value = await cache.GetAsync(key); 717var value = await cache.GetAsync(key);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (19)
RedisCacheSetAndRemoveTests.cs (4)
122Assert.Null(await cache.GetAsync(key)); // expect null 125var arr = await cache.GetAsync(key); 162Assert.Null(await cache.GetAsync(key)); // expect null 166var raw = await cache.GetAsync(key);
TimeExpirationAsyncTests.cs (15)
64byte[] result = await cache.GetAsync(key); 70result = await cache.GetAsync(key); 85var result = await cache.GetAsync(key); 130var result = await cache.GetAsync(key); 136result = await cache.GetAsync(key); 150var result = await cache.GetAsync(key); 192var result = await cache.GetAsync(key); 197result = await cache.GetAsync(key); 210var result = await cache.GetAsync(key); 223var result = await cache.GetAsync(key); 230result = await cache.GetAsync(key); 235result = await cache.GetAsync(key); 251var result = await cache.GetAsync(key); 258result = await cache.GetAsync(key); 268result = await cache.GetAsync(key);