Class IOptionsRegistrationExtensions
- Namespace
- Acuit.Pinpoint.Workstation.Configuration
- Assembly
- Acuit.Pinpoint.Workstation.Interfaces.dll
Extension methods for IOptionsRegistration<TOptions>.
public static class IOptionsRegistrationExtensions
- Inheritance
-
IOptionsRegistrationExtensions
- Inherited Members
Methods
RegisterOptionsWatcher<TOptions>(IOptionsRegistration<TOptions>, Action, OptionsWatcherOptions, int)
Registers an options watcher with a synchronous callback.
public static IDisposable RegisterOptionsWatcher<TOptions>(this IOptionsRegistration<TOptions> registration, Action callback, OptionsWatcherOptions options = OptionsWatcherOptions.None, int priority = 0) where TOptions : class
Parameters
registration
IOptionsRegistration<TOptions>The IOptionsRegistration<TOptions> instance.
callback
ActionThe synchronous callback.
options
OptionsWatcherOptionsOptions for the options watcher registration.
priority
intThe watcher priority. Higher values indicate higher priority.
Returns
- IDisposable
A IDisposable that can be used to unregister the watcher.
Type Parameters
TOptions
The options instance type.
Remarks
See RegisterOptionsWatcherAsync(Func<Task>, OptionsWatcherOptions, int) for details about registering options watchers.
Exceptions
- ArgumentNullException
registration
orcallback
is null.
RegisterOptionsWatcher<TOptions>(IOptionsRegistration<TOptions>, Func<Task>, OptionsWatcherOptions, int)
Synchronously registers an options watcher.
public static IDisposable RegisterOptionsWatcher<TOptions>(this IOptionsRegistration<TOptions> registration, Func<Task> callback, OptionsWatcherOptions options = OptionsWatcherOptions.None, int priority = 0) where TOptions : class
Parameters
registration
IOptionsRegistration<TOptions>The IOptionsRegistration<TOptions> instance.
callback
Func<Task>The asynchronous callback.
options
OptionsWatcherOptionsOptions for the options watcher registration, which may not include InvokeNow.
priority
intThe watcher priority. Higher values indicate higher priority.
Returns
- IDisposable
A IDisposable that can be used to unregister the watcher.
Type Parameters
TOptions
The options instance type.
Remarks
See RegisterOptionsWatcherAsync(Func<Task>, OptionsWatcherOptions, int) for details about registering options watchers.
Exceptions
- ArgumentNullException
registration
orcallback
is null.- InvalidOperationException
The InvokeNow option is not allowed.