public void Update(tblStudent oStudent) { try { using (var ctx = new CRUDSampleEntities()) { ctx.tblContactDetails.Attach(oStudent.tblContactDetail); ctx.Entry(oStudent.tblContactDetail).State = EntityState.Modified; ctx.tblStudents.Attach(oStudent); ctx.Entry(oStudent).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception ex) { throw ex; } }
public void Update(tblCatalog oCatalog) { try { using (var ctx = new CRUDSampleEntities()) { ctx.Entry(oCatalog).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception ex) { throw ex; } }