public async Task <IActionResult> Edit(int id, [Bind("ReviewId,ProductName,UserName,ReviewText")] Review review) { if (id != review.ReviewId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(review); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewExists(review.ReviewId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(review)); }
public async Task <IActionResult> Edit(int id, [Bind("Brand,Name,RyansPrice,StarPrice,StarLink,RyansLink,PicLink,Storage,Description,HddId")] HddFinal hddFinal) { if (id != hddFinal.HddId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hddFinal); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HddFinalExists(hddFinal.HddId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hddFinal)); }