public void SaveMessage(ContactFormViewModel model) { using (var uow = _uowFactory.Create()) { uow.MessageRepository.Update(model.ToContactFormEntity()); } }
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); } }