山东雷驰
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
646 B

using System.Threading;
using System.Threading.Tasks;
namespace Kean.Domain
{
public class NotificationEventHandler : IEventHandler<NotificationEvent>
{
protected INotification _notifications; // 通知
/*
* 构造函数
*/
public NotificationEventHandler(INotification notifications) =>
_notifications = notifications;
/*
* 事件处理程序
*/
public virtual Task Handle(NotificationEvent @event, CancellationToken cancellationToken)
{
_notifications.Add(@event);
return Task.CompletedTask;
}
}
}