public void Edit(Physician _physicianEntry) { using (context = new DataFetchContext()) { context.Physicians.Attach(_physicianEntry); context.Entry<Physician>(_physicianEntry).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void Create(Physician _physicianEntry) { using (context = new DataFetchContext()) { _physicianEntry.ID = Guid.NewGuid(); context.Physicians.Add(_physicianEntry); context.Entry<Physician>(_physicianEntry).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } }