public ComposeEmailViewModel(IEnumerable<Video> videos) { Videos = videos.ToList(); Message = new Message(); }
public void InsertOrUpdate(Message message) { if (message.Id == default(int)) { // New entity context.Messages.Add(message); } else { // Existing entity context.Entry(message).State = EntityState.Modified; } }
public void ChiroToPatientMessage() { var message = new Message(); message.From = "*****@*****.**"; message.To = "*****@*****.**"; message.Content = "test"; MessageRepository repo = new MessageRepository(); repo.InsertOrUpdate(message); repo.Save(); message = repo.AllIncluding().FirstOrDefault(x => x.From == "*****@*****.**"); Assert.IsNotNull(message); }