Share via


SingletonOptionsMonitor<TOptions> Class

Definition

Provides a singleton implementation of IOptionsMonitor<TOptions> that always returns the same options instance.

public class SingletonOptionsMonitor<TOptions> : Microsoft.Extensions.Options.IOptions<TOptions>, Microsoft.Extensions.Options.IOptionsMonitor<TOptions>, Microsoft.Extensions.Options.IOptionsSnapshot<TOptions> where TOptions : class
type SingletonOptionsMonitor<'Options (requires 'Options : null)> = class
    interface IOptionsMonitor<'Options (requires 'Options : null)>
    interface IOptionsSnapshot<'Options (requires 'Options : null)>
    interface IOptions<'Options (requires 'Options : null)>
Public Class SingletonOptionsMonitor(Of TOptions)
Implements IOptions(Of TOptions), IOptionsMonitor(Of TOptions), IOptionsSnapshot(Of TOptions)

Type Parameters

TOptions

The type of options being monitored.

Inheritance
SingletonOptionsMonitor<TOptions>
Implements
IOptions<TOptions> IOptionsMonitor<TOptions> IOptionsSnapshot<TOptions>

Constructors

Name Description
SingletonOptionsMonitor<TOptions>(TOptions)

Provides a singleton implementation of IOptionsMonitor<TOptions> that always returns the same options instance.

Properties

Name Description
CurrentValue

Gets the current options value.

Value

Gets the options value.

Methods

Name Description
Get(String)

Gets the options instance with the specified name.

OnChange(Action<TOptions,String>)

Registers a change listener (no-op in this implementation).

Applies to