コード例 #1
0
        public void Handle(SendNotificationCommand command)
        {
            string email = _emailRepository.GetEmail(command.LoginName);

            _smtpClient.Send(email, command.Title, command.Body);

            _notificationRepository.Add(email, command.Title, command.Body, _dateTimeProvider.Now(), command.LoginName, command.NotificationType);

            _eventBus.Publish(new NotificationSentEvent()
            {
                LoginName        = command.LoginName,
                Email            = email,
                NotificationType = command.NotificationType
            });
        }
コード例 #2
0
 public GetEmailResponse Handle(string loginName)
 {
     return(new GetEmailResponse(_repository.GetEmail(loginName)));
 }