Class ActionEventHandler<TEvent>
This event handler is an adapter to be able to use an action as ILocalEventHandler<TEvent> implementation.
Inheritance
System.Object
ActionEventHandler<TEvent>
Namespace: Volo.Abp.EventBus
Assembly: Volo.Abp.EventBus.dll
Syntax
public class ActionEventHandler<TEvent> : object, ILocalEventHandler<TEvent>, IEventHandler, ITransientDependency
Type Parameters
Name | Description |
---|---|
TEvent | Event type |
Constructors
ActionEventHandler(Func<TEvent, Task>)
Creates a new instance of ActionEventHandler<TEvent>.
Declaration
public ActionEventHandler(Func<TEvent, Task> handler)
Parameters
Type | Name | Description |
---|---|---|
Func<TEvent, Task> | handler | Action to handle the event |
Properties
Action
Function to handle the event.
Declaration
public Func<TEvent, Task> Action { get; }
Property Value
Type | Description |
---|---|
Func<TEvent, Task> |
Methods
HandleEventAsync(TEvent)
Handles the event.
Declaration
public Task HandleEventAsync(TEvent eventData)
Parameters
Type | Name | Description |
---|---|---|
TEvent | eventData |
Returns
Type | Description |
---|---|
Task |