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