Exemple #1
0
        public IActionResult CreateCinemaRoom([FromBody] CinemaRoomInfo cinemaRoom, int cinemaId)
        {
            ResultCreated result = сinemaService.CreateCinemaRoom(cinemaId, cinemaRoom);

            if (result.ResultOk)
            {
                return(Created($"api/cinemas/{cinemaId}/cinemaRooms/{result.Id}", typeof(CinemaRoom)));
            }
            return(BadRequest(result));
        }
Exemple #2
0
        public IActionResult CreateCinema([FromBody] CinemaInfo cinemaInfo)
        {
            ResultCreated result = сinemaService.CreateCinema(cinemaInfo);

            if (result.ResultOk)
            {
                return(Created($"api/cinemas/{result.Id}", typeof(Cinema)));
            }
            return(BadRequest(result));
        }
Exemple #3
0
        public IActionResult CreateFilm([FromBody] FilmInfo filmInfo)
        {
            ResultCreated result = filmService.CreateFilm(filmInfo);

            if (result.ResultOk)
            {
                return(Created($"api/films/{result.Id}", typeof(Film)));
            }
            return(BadRequest(result));
        }
Exemple #4
0
        public IActionResult CreateSession([FromBody] SessionInfo sessionInfo)
        {
            ResultCreated result = sessionService.CreateSession(sessionInfo);

            if (result.ResultOk)
            {
                return(Created($"api/sessions/{result.Id}", typeof(Session)));
            }
            return(BadRequest(result));
        }
Exemple #5
0
        public IActionResult CreateOrder([FromBody] OrderInfo order)
        {
            ResultCreated result = orderService.CreateOrder(order);

            if (result.ResultOk)
            {
                return(Created($"api/orders/{result.Id}", typeof(Order)));
            }
            return(BadRequest(result));
        }