OptionsMonitorExtensions.OnChange<TOptions>(IOptionsMonitor<TOptions>, Action<TOptions>) 메서드

정의

TOptions가 변경될 때마다 호출될 수신기를 등록합니다.Registers a listener to be called whenever TOptions changes.

public:
generic <typename TOptions>
[System::Runtime::CompilerServices::Extension]
 static IDisposable ^ OnChange(Microsoft::Extensions::Options::IOptionsMonitor<TOptions> ^ monitor, Action<TOptions> ^ listener);
public static IDisposable OnChange<TOptions> (this Microsoft.Extensions.Options.IOptionsMonitor<TOptions> monitor, Action<TOptions> listener);
static member OnChange : Microsoft.Extensions.Options.IOptionsMonitor<'Options> * Action<'Options> -> IDisposable
<Extension()>
Public Function OnChange(Of TOptions) (monitor As IOptionsMonitor(Of TOptions), listener As Action(Of TOptions)) As IDisposable

형식 매개 변수

TOptions

매개 변수

monitor
IOptionsMonitor<TOptions>

IOptionsMonitor입니다.The IOptionsMonitor.

listener
Action<TOptions>

TOptions가 변경될 때 호출될 동작입니다.The action to be invoked when TOptions has changed.

반환

IDisposable

변경 수신 대기를 중지하기 위해 삭제해야 하는 IDisposable입니다.An IDisposable which should be disposed to stop listening for changes.

적용 대상