예제 #1
0
 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();
 }
예제 #2
0
        public SendSmsCommand Add(string phone, string body, Guid?referenceId = null)
        {
            var result = new SendSmsCommand()
            {
                Body        = body,
                Phone       = phone,
                ReferenceId = referenceId
            };

            Add(result);
            return(result);
        }