public void Update(Kh obj) { using (var db = new QLBH_WinDBContext()) { db.Khs.Attach(obj); db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); } }
public Kh Insert(Kh obj) { using (var db = new QLBH_WinDBContext()) { db.Khs.Add(obj); db.SaveChanges(); return(obj); } }
public void Delete(Kh obj) { using (var db = new QLBH_WinDBContext()) { db.Khs.Attach(obj); db.Khs.Remove(obj); db.SaveChanges(); } }
partial void DeleteKh(Kh instance);
partial void UpdateKh(Kh instance);
partial void InsertKh(Kh instance);