예제 #1
0
 // 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)));
     }
 }
예제 #2
0
 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));
     }
 }