Esempio n. 1
0
        public async Task AddShow(Guid cinemaId, Guid showId, CreateShowRequest request)
        {
            Cinema cinema = await _ctx.Cinemas.Include(c => c.Shows).FirstOrDefaultAsync(c => c.Id == cinemaId);

            Movie movie = await _ctx.Movies.FindAsync(request.MovieId);

            Dictionary <Ticket, decimal> priceList = request.PriceList.ToDictionary(x => x.Kind, x => x.Price);
            Show show = ShowFactory.Create(showId, cinema, movie, request.Date, priceList);

            cinema.AddShow(show);
            await _ctx.SaveChangesAsync();
        }
Esempio n. 2
0
        public static bool InsertNewShow(int sellerid, string name, int price, string description)
        {
            Show newShow = ShowFactory.Create(sellerid, name, price, description);

            return(ShowsRepository.InsertShow(newShow));
        }