Пример #1
0
 public long Insert(Contact contact)
 {
     Context.Contacts.Add(contact);
     Context.SaveChanges();
     return contact.Id;
 }
Пример #2
0
 public void Update(int id, Contact contact)
 {
     var updateContact = Context.Contacts.Single(x => x.Id == id);
     updateContact.Address = contact.Address;
     updateContact.FirstName = contact.FirstName;
     updateContact.LastName = contact.LastName;
     updateContact.City = contact.City;
     updateContact.ZipCode = contact.ZipCode;
     updateContact.Email = contact.Email;
     updateContact.BirthDate = contact.BirthDate;
     Context.SaveChanges();
 }