Auf Englisch lesen

Freigeben über


OptionsCache<TOptions> Class

Definition

Caches TOptions instances.

C#
public class OptionsCache<TOptions> : Microsoft.Extensions.Options.IOptionsMonitorCache<TOptions> where TOptions : class

Type Parameters

TOptions

The type of options being requested.

Inheritance
OptionsCache<TOptions>
Implements

Constructors

OptionsCache<TOptions>()

Initializes an instance of the OptionsCache<TOptions> class.

Methods

Clear()

Clears all options instances from the cache.

GetOrAdd(String, Func<TOptions>)

Gets a named options instance, or adds a new instance created with createOptions.

TryAdd(String, TOptions)

Tries to adds a new option to the cache.

TryRemove(String)

Tries to remove an options instance.

Applies to

Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)