using System;
using Abp.Dependency;
namespace Abp.Events.Bus.Handlers.Internals
{
///
/// This event handler is an adapter to be able to use an action as implementation.
///
/// Event type
internal class ActionEventHandler :
IEventHandler,
ITransientDependency
{
///
/// Action to handle the event.
///
public Action Action { get; private set; }
///
/// Creates a new instance of .
///
/// Action to handle the event
public ActionEventHandler(Action handler)
{
Action = handler;
}
///
/// Handles the event.
///
///
public void HandleEvent(TEventData eventData)
{
Action(eventData);
}
}
}