public void SaveSmsMessage(DtoSmsMessage message) { _context.Add(new SmsMessage { Id = message.Id, CreateDate = DateTime.Now, Phone = message.Phone, Text = message.Text }); _context.SaveChanges(); }
public ActionResult SendSms(DtoSmsMessage message) { if (!_settings.IsSmsSenderActive) { return(StatusCode(StatusCodes.Status503ServiceUnavailable)); } _messageRepository.SaveSmsMessage(message); _traceService.WriteMessageAsync( "SmsMessage", $"{message.Phone}: {message.Text}" ); return(Ok()); }