public void InsertRecord(tblHospital obj) { //obj.ID = 18; db.tblHospitals.Add(obj); db.SaveChanges(); }
public void UpdateRecord(tblHospital obj) { db.tblHospitals.Attach(obj); var update = db.Entry(obj); update.Property(x => x.HospitalName).IsModified = true; update.Property(x => x.Description).IsModified = true; db.SaveChanges(); }