public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Price")] Products products) { if (id != products.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(products); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductsExists(products.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(products)); }