Nucleus .Net Core CMS

EventHandlers.EventHandlerExtensions Class

Namespace: Nucleus.Abstractions.EventHandlers
Assembly: Nucleus.Abstractions.dll
Extension methods for adding Nucleus system event handlers.

Methods

AddScopedSystemEventHandler<TModel, TEvent, THandler> (IServiceCollection) Method

AddScopedSystemEventHandler<TModel, TEvent, THandler> (Microsoft.Extensions.DependencyInjection.IServiceCollection)
Add a scoped system event handler of THandler for the specified TModel, TEvent.
Type Parameters
TModel
TEvent
THandler
Remarks
Scoped system event handlers can only be used from within a controller action, because the event dispatcher requires a current HttpContext.

AddSingletonSystemEventHandler<TModel, TEvent, THandler> (IServiceCollection) Method

AddSingletonSystemEventHandler<TModel, TEvent, THandler> (Microsoft.Extensions.DependencyInjection.IServiceCollection)
Add a singleton system event handler of THandler for the specified TModel, TEvent.
Type Parameters
TModel
TEvent
THandler
Remarks
Singleton system event handlers are used when an event is raised from a scheduled task, or in other cases where there isn't a current HttpContext.