Nucleus .Net Core CMS

EventHandlers.ISingletonSystemEventHandler<TModel, TEvent> Interface

Namespace: Nucleus.Abstractions.EventHandlers
Assembly: Nucleus.Abstractions.dll
System event handler abstract class. Event handlers implement this class, and are added to the dependency injection services collection with a call to AddTransient.
Type Parameters
TModel The type of the data item which the event is for. This can be any type and is the object type which is passed to the Invoke method.
TEvent The type of the event. This can be any class. The TEvent class is used to couple the subscription and ISystemEventHandler implementation to a specific type of event. The TEvent type does not require any particular implementation, it is used as a marker.

Remarks

Use this interface to create a singleton event handler, which cannot receive scoped parameters in its constructor. Singleton system event handlers are used when an event is raised in a scheduled task, or in other cases where there isn't a current HttpContext. Implementations of ISingletonSystemEventHandler handle a single model type and event type represented by TEvent and TModel.