コード例 #1
0
 public ActionResult Edit(Phong obj)
 {
     obj.SaveFor(q => q.Anh);
     if (obj.IDPhong > 0)
     {
         db.Entry(obj).State = EntityState.Modified;
     }
     else
     {
         db.Phongs.Add(obj);
     }
     db.SaveChanges();
     return(RedirectToAction("Index", "Phong"));
 }