コード例 #1
0
        public IActionResult GetCinema(int cinemaId)
        {
            GetResult <ResponseCinemaFullInfo> result = сinemaService.GetCinema(cinemaId);

            if (result.ResultOk)
            {
                return(Ok(result));
            }
            return(NotFound(result));
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
 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());
     }
 }