public void InsertContact(Contact contact) { using (var context = new ContactsContext()) { context.Contacts.Add(contact); context.SaveChanges(); } }
public void UpdateContact(Contact contact) { using (var context = new ContactsContext()) { context.Database.ExecuteSqlCommand( "exec ReplaceContact {0}, {1}, {2}", contact.ContactId, contact.FirstName, contact.LastName); } }
public ContactUpdatedEvent(Contact contact, bool isNew) : this() { Contact = contact; IsNew = isNew; }