コード例 #1
0
 public void SaveMessage(ContactFormViewModel model)
 {
     using (var uow = _uowFactory.Create())
     {
         uow.MessageRepository.Update(model.ToContactFormEntity());
     }
 }
コード例 #2
0
        public void AddMessage(ContactFormViewModel model)
        {
            using (var uow = _uowFactory.Create())
            {
                model.MessageStatus = _sendMessageProvider.SendEmail($"{model.Message} (Name: {model.Name}, Phone: {model.Phone})", model.Email, "new contact message");

                var entity = model.ToContactFormEntity();
                entity.Date = DateTime.Now;
                uow.MessageRepository.Add(entity);
            }
        }