public ActionResult Edit([Bind(Include = "ProductID,Name,Description,Price,Category")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
示例#2
0
 public HttpResponseMessage Put(int id, [FromBody] TblProduct value)
 {
     SportsDB.Entry(value).State = EntityState.Modified;
     return(ToJson(SportsDB.SaveChanges()));
 }