ChangeToken Class¶
Propagates notifications that a change has occured.
- Namespace
Microsoft.Extensions.Primitives
- Assemblies
- Microsoft.Extensions.Primitives
Methods¶
-
OnChange
(System.Func<Microsoft.Extensions.Primitives.IChangeToken>, System.Action)¶ Registers the <em>changeTokenConsumer</em> action to be called whenever the token produced changes.
Arguments: - changeTokenProducer (System.Func<Microsoft.Extensions.Primitives.IChangeToken>) – Produces the change token.
- changeTokenConsumer (System.Action) – Action called when the token changes.
Return type: System.IDisposable
public static IDisposable OnChange(Func<IChangeToken> changeTokenProducer, Action changeTokenConsumer)
-
OnChange<TState>
(System.Func<Microsoft.Extensions.Primitives.IChangeToken>, System.Action<TState>, TState)¶ Registers the <em>changeTokenConsumer</em> action to be called whenever the token produced changes.
Arguments: - changeTokenProducer (System.Func<Microsoft.Extensions.Primitives.IChangeToken>) – Produces the change token.
- changeTokenConsumer (System.Action<TState>) – Action called when the token changes.
- state (TState) – state for the consumer.
Return type: System.IDisposable
public static IDisposable OnChange<TState>(Func<IChangeToken> changeTokenProducer, Action<TState> changeTokenConsumer, TState state)
-