private async Task OnTimeoutAsync(Object source, string smtpServer, IEnumerable <MailMessage> mailMessages, DateTime scheduledSendDateTime) { if (scheduledSendDateTime.ToShortTimeString() == DateTime.Now.ToShortTimeString()) { await SendEmailNow(smtpServer, mailMessages, true); var sendedEmail = _messageRepository.GetAll().Where(x => x.ScheduledSendDateTime == scheduledSendDateTime).FirstOrDefault().ToDomain(); sendedEmail.SendDateTime = DateTime.Now; sendedEmail.ScheduledSendDateTime = null; _messageRepository.Save(sendedEmail.ToEntity()); messageSend.Invoke(); } }
public int Edit(Sender sender) { return(_repository.Save(sender.ToEntity())); }
public int Edit(Host host) { return(_repository.Save(host.ToEntity())); }
public int Edit(Recipient recipient) { return(_repository.Save(recipient.ToEntity())); }