예제 #1
0
        public async Task <GetEventByIdRequest> GetEventById(int eventId)
        {
            Event eventById;

            try
            {
                eventById = await _eventRepository.GetEventById(eventId);
            }
            catch
            {
                throw;
            }

            var types = await _eventRepository.GetNumberOfSeatsByType(eventById.PlaceId);

            var sectorPrices = await _eventRepository.GetSectorPrices(eventById.EventId);

            var convertedPrices = sectorPrices.Select(sp => _sectorConverter.SectorPriceToGetSectorPricesResponse(sp)).ToList();

            var convertedEvent = _eventConverter.EventToGetEventByIdRequest(eventById, types, convertedPrices);

            return(convertedEvent);
        }