public IActionResult GetCinema(int cinemaId) { GetResult <ResponseCinemaFullInfo> result = сinemaService.GetCinema(cinemaId); if (result.ResultOk) { return(Ok(result)); } return(NotFound(result)); }
public IActionResult GetCinema(int cinemaId) { if (!_сinemaService.CheckCinemaExists(cinemaId)) { return(NotFound(new Response(ErrorOfCinemaNonexistence))); } var cinema = _сinemaService.GetCinema(cinemaId); return(Ok(new GetResponse <CinemaView>(cinema))); }
public IHttpActionResult GetMovie(string key, int id) { if (Startup.key != key) { return(BadRequest("Incorrect key")); } System.Console.WriteLine("GET cinema by Id=" + id); try { var cinema = _ICinemaService.GetCinema(id); return(Ok(new { results = cinema })); } catch (System.Exception) { return(InternalServerError()); } }