MemoryDistributedCache Class

Definition

Implements IDistributedCache using IMemoryCache.

C#
public class MemoryDistributedCache : Microsoft.Extensions.Caching.Distributed.IDistributedCache
Inheritance
MemoryDistributedCache
Implements

Constructors

Methods

Get(String)

Gets the specified item associated with a key from the IMemoryCache as a byte array.

GetAsync(String, CancellationToken)

Asynchronously gets the specified item associated with a key from the IMemoryCache as a byte array.

Refresh(String)

Refreshes the specified item associated with a key from the IMemoryCache.

RefreshAsync(String, CancellationToken)

Asynchronously refreshes the specified item associated with a key from the IMemoryCache.

Remove(String)

Removes the specified item associated with a key from the IMemoryCache.

RemoveAsync(String, CancellationToken)

Asynchronously removes the specified item associated with a key from the IMemoryCache.

Set(String, Byte[], DistributedCacheEntryOptions)

Sets the specified item associated with a key in the IMemoryCache as a byte array.

SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)

Asynchronously sets the specified item associated with a key in the IMemoryCache as a byte array.

Extension Methods

GetString(IDistributedCache, String)

Gets a string from the specified cache with the specified key.

GetStringAsync(IDistributedCache, String, CancellationToken)

Asynchronously gets a string from the specified cache with the specified key.

Set(IDistributedCache, String, Byte[])

Sets a sequence of bytes in the specified cache with the specified key.

SetAsync(IDistributedCache, String, Byte[], CancellationToken)

Asynchronously sets a sequence of bytes in the specified cache with the specified key.

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

Sets a string in the specified cache with the specified key.

SetString(IDistributedCache, String, String)

Sets a string in the specified cache with the specified key.

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions, CancellationToken)

Asynchronously sets a string in the specified cache with the specified key.

SetStringAsync(IDistributedCache, String, String, CancellationToken)

Asynchronously sets a string in the specified cache with the specified key.

Applies to

Toode Versioonid
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)