Пример #1
0
        public ActionResult <CinemaResponse> GetCinema(int id)
        {
            CinemaResponse cinemaResponse = cinemaServices.GetCinema(id);

            if (cinemaResponse == null)
            {
                return(NotFound());
            }

            return(cinemaResponse);
        }
Пример #2
0
        public ActionResult <HallResponse> PostHall(HallEntity hallEntity, int cinemaId)
        {
            if (!ModelState.IsValid || cinemaServices.GetCinema(cinemaId) == null)
            {
                return(BadRequest());
            }

            hallEntity.CinemaId = cinemaId;

            HallResponse hallResponse = hallServices.SaveHall(hallEntity);

            if (hallResponse == null)
            {
                return(BadRequest());
            }

            return(CreatedAtAction("GetHall", new { id = hallEntity.Id }, hallResponse));
        }