Пример #1
0
 public void Update(Kh obj)
 {
     using (var db = new QLBH_WinDBContext())
     {
         db.Khs.Attach(obj);
         db.Entry(obj).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #2
0
 public Kh Insert(Kh obj)
 {
     using (var db = new QLBH_WinDBContext())
     {
         db.Khs.Add(obj);
         db.SaveChanges();
         return(obj);
     }
 }
Пример #3
0
 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);