示例#1
0
 public void InsertContact(Contact contact)
 {
     using (var context = new ContactsContext()) {
     context.Contacts.Add(contact);
     context.SaveChanges();
       }
 }
示例#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);
       }
 }
示例#3
0
 public ContactUpdatedEvent(Contact contact, bool isNew)
     : this()
 {
     Contact = contact;
       IsNew = isNew;
 }