public void Add(SendEmailCommand command) { if (command.Id == Guid.Empty) { command.Id = Guid.NewGuid(); } command.Status = EmailStatus.InQueue; command.CreateDate = DateTime.Now; Context.SendEmailCommands.Add(command); Context.SaveChanges(); // todo репозиторий не должен сохранять изменения }
public SendEmailCommand Add(string to, string subject, string body, Guid?referenceId = null) { var result = new SendEmailCommand() { Body = body, IsHtml = true, Subject = subject, To = to, ReferenceId = referenceId }; Add(result); return(result); }