Clean Architecture Demo
Toggle main menu visibility
Loading...
Searching...
No Matches
TaskCompletedNotificationHandler.cs
Go to the documentation of this file.
1
using
TaskManagement.Application.Ports
;
2
using
TaskManagement.Domain.Events
;
3
4
namespace
TaskManagement.Application.Events
;
5
17
public
sealed
class
TaskCompletedNotificationHandler
: IDomainEventSubscriber<TaskCompletedEvent>
18
{
19
private
readonly
IEmailService
_emailService;
20
21
public
TaskCompletedNotificationHandler
(
IEmailService
emailService)
22
{
23
_emailService = emailService;
24
}
25
26
public
Task
HandleAsync
(
TaskCompletedEvent
domainEvent, CancellationToken cancellationToken =
default
)
27
{
28
ArgumentNullException.ThrowIfNull(domainEvent);
29
30
return
_emailService.SendTaskCompletedNotificationAsync(domainEvent.
TaskId
, cancellationToken);
31
}
32
}
TaskManagement.Application.Events.TaskCompletedNotificationHandler.TaskCompletedNotificationHandler
TaskCompletedNotificationHandler(IEmailService emailService)
Definition
TaskCompletedNotificationHandler.cs:21
TaskManagement.Application.Events.TaskCompletedNotificationHandler.HandleAsync
Task HandleAsync(TaskCompletedEvent domainEvent, CancellationToken cancellationToken=default)
Definition
TaskCompletedNotificationHandler.cs:26
TaskManagement.Domain.Events.TaskCompletedEvent
Definition
DomainEvent.cs:70
TaskManagement.Domain.Events.TaskCompletedEvent.TaskId
Guid TaskId
Definition
DomainEvent.cs:71
TaskManagement.Application.Ports.IEmailService
IEmailService es la abstracción para envío de notificaciones por correo electrónico.
Definition
IEmailService.cs:39
TaskManagement.Application.Events
Definition
IDomainEventSubscriber.cs:3
TaskManagement.Application.Ports
Definition
IDomainEventDispatcher.cs:3
TaskManagement.Domain.Events
Definition
DomainEvent.cs:4
src
TaskManagement.Application
Events
TaskCompletedNotificationHandler.cs
Generated by
1.18.0