public void Add(SendSmsCommand command) { if (command.Id == Guid.Empty) { command.Id = Guid.NewGuid(); } command.Status = SmsStatus.InQueue; command.CreateDate = DateTime.Now; Context.SendSmsCommands.Add(command); Context.SaveChanges(); }
public SendSmsCommand Add(string phone, string body, Guid?referenceId = null) { var result = new SendSmsCommand() { Body = body, Phone = phone, ReferenceId = referenceId }; Add(result); return(result); }