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)); }
public HttpResponseMessage Put(int id, [FromBody] TblProduct value) { SportsDB.Entry(value).State = EntityState.Modified; return(ToJson(SportsDB.SaveChanges())); }