// GET: Club/Create public ActionResult Create() { try { ViewBag.Cities = _getCitiesCommand.Execute(new CitySearch()); ViewBag.Leagues = _getLeaguesCommand.Execute(new LeagueSearch()); return(View()); } catch (Exception) { return(RedirectToAction(nameof(Index))); } }
public ActionResult <IEnumerable <LeagueDto> > Get([FromQuery] LeagueSearch leagueSearch) { try { var leagues = _getLeaguesCommand.Execute(leagueSearch); return(Ok(leagues)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }