EventHandlers.IEventDispatcher Interface
Namespace: Nucleus.Abstractions.EventHandlers
Assembly: Nucleus.Abstractions.dll
Raises notification events. Internal and custom implementations can acquire a reference to EventDispatcher from the dependency injection services container and raise or consume events.
Examples
// Adding an event handler:
services.AddTransient<ISystemEventHandler<User, Create>, UserEventHandler>();
// Raising an Event:
eventDispatcher.RaiseEvent<User, Create>(myuser)
Methods
RaiseEvent<TModel, TEvent>
(<TModel>) Method
RaiseEvent<TModel, TEvent> (<TModel> item)
Call RaiseEvent to submit an event to the Event Dispatcher. The Invoke method will be called for all implementations of ISystemEventHandler{TModel, TEvent} in the services collection.