// GET: Movies/Create public ActionResult Create() { try { ViewBag.Genres = getGenres.Execute(new GenreQuery { PerPage = 100 }).Data; ViewBag.Actors = getActors.Execute(new ActorQuery { PerPage = 100 }).Data; ViewBag.Languages = getLanguages.Execute(new LanguageQuery()).Data; ViewBag.Writers = getWriters.Execute(new WriterQuery()).Data; ViewBag.Countries = getCountries.Execute(new CountryQuery()).Data; ViewBag.Productions = getProductions.Execute(new ProductionQuery()).Data; ViewBag.Rateds = getRateds.Execute(new RatedQuery()).Data; return(View()); } catch (Exception e) { TempData["error"] = e.Message; } return(RedirectToAction(nameof(Create))); }
public IActionResult Get([FromQuery] LanguageQuery query) { try { return(Ok(getLanguages.Execute(query))); } catch (Exception e) { return(StatusCode(500, new { Errors = new List <string> { e.Message } })); } }