public IActionResult ToPlanet(long id) { if (_spaceshipService.AbleToMoveToPlanet()) { _planetService.ToPlanet(id); ViewBag.move = true; ViewBag.spaceships = _spaceshipService.GetSpaceship(); return(View(nameof(Index), _planetService.GetAllPlanets())); } else { ViewBag.move = false; ViewBag.spaceships = _spaceshipService.GetSpaceship(); return(View(nameof(Index), _planetService.GetAllPlanets())); } }
public IActionResult ToPlanet(long id) { _planetService.ToPlanet(id); return(RedirectToAction(nameof(Index))); }