OptionsMonitor<TOptions> Class

Definition

C#
public class OptionsMonitor<TOptions> : IDisposable, Microsoft.Extensions.Options.IOptionsMonitor<TOptions> where TOptions : class

Type Parameters

TOptions

The options type.

Inheritance
OptionsMonitor<TOptions>
Implements

Constructors

Properties

CurrentValue

Gets the present value of the options (equivalent to Get(Options.DefaultName)).

Methods

Dispose()

Removes all change registration subscriptions.

Get(String)

Returns a configured TOptions instance with the given name.

OnChange(Action<TOptions,String>)

Registers a listener to be called whenever TOptions changes.

Extension Methods

OnChange<TOptions>(IOptionsMonitor<TOptions>, Action<TOptions>)

Registers a listener to be called whenever TOptions changes.

Applies to

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