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