public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,BirthDate,Weight,Height,PersonalBest,CountryId")] Jumper jumper) { if (id != jumper.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jumper); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JumperExists(jumper.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Name", jumper.CountryId); return(View(jumper)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,CountryRecord")] Country country) { if (id != country.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(country); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(country.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(country)); }