public void UpdateInDatabase(int id, ContactEntity contactEntity) { if (contactEntity == null) { throw new ArgumentNullException(nameof(contactEntity)); } var contact = contactEntity.ToModel(); using (var ipPhoneEntities = new IPPhoneEntities()) { ipPhoneEntities.SaveChanges(); } }
public void CreateInDatabase(ContactEntity contactEntity) { if (contactEntity == null) { throw new ArgumentNullException(nameof(contactEntity)); } var contact = contactEntity.ToModel(); contact.Id = Guid.NewGuid(); using (var ipPhoneEntities = new IPPhoneEntities()) { ipPhoneEntities.Contacts.Add(contact); ipPhoneEntities.SaveChanges(); } }