public async Task <IActionResult> Edit(int id, [Bind("IdCountry,CountryName,Status")] Country country) { if (id != country.IdCountry) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(country); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(country.IdCountry)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(country)); }