<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.10" />

Microsoft.Extensions.Options.OptionsMonitor<TOptions>

public class OptionsMonitor<TOptions> : IOptionsMonitor<TOptions>, IDisposable
Implements IOptionsMonitor<T>.
public TOptions CurrentValue { get; }

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

public OptionsMonitor(IOptionsFactory<TOptions> factory, IEnumerable<IOptionsChangeTokenSource<TOptions>> sources, IOptionsMonitorCache<TOptions> cache)

Initializes a new instance of OptionsMonitor<T> with the specified factory, sources, and cache.

public void Dispose()

Removes all change registration subscriptions.

public virtual TOptions Get(string name)

Returns a configured TOptions instance with the given name.

public IDisposable OnChange(Action<TOptions, string> listener)

Registers a listener to be called whenever TOptions changes.