public async Task <ActionResult> Edit([Bind(Include = "ProductId,ItemId,OldProductId,OldItemId")] ProductItem productItem) { if (ModelState.IsValid) { var canChange = await productItem.canChange(db); if (canChange) { await productItem.Change(db); } return(RedirectToAction("Index")); } return(View(productItem)); }