public List <VenueDto> GetAllVenue() { List <Venue> objs = _venueRepository.GetAll().ToList(); var objsDto = new List <VenueDto>(); foreach (var item in objs) { objsDto.Add(ConvertToDto(item)); } return(objsDto); }
public async Task <IList <ConcertDescriptionResponseModel> > GetTrendingConcerts(int userId) { var concerts = await _concertRepository.GetAll(); var venues = (await _venueRepository.GetAll()).ToDictionary(x => x.Id); var myWishlist = (await _wishlistRepository.GetUserWhishlistAsync(userId)).ToDictionary(x => x.ConcertId); return(concerts.Select(x => new ConcertDescriptionResponseModel { Date = x.ConcertDate, Duration = "TBD", Id = x.Id, Name = x.Name, VenueName = venues[x.Id].VenueName, AddedToWishlist = myWishlist.ContainsKey(x.Id) }).ToList()); }
public IEnumerable <Venue> GetAllVenues() { try { return(_venueRepository.GetAll()); } catch (Exception ex) { _logger.LogError(ex.StackTrace); throw; } }
public IEnumerable <Venue> GetAll() { var allEntities = _venueRepository.GetAll(); var result = new List <Venue>(); foreach (var entity in allEntities) { var venueVm = VenueMapper.FromEntity(entity); result.Add(venueVm); } return(result); }
public IEnumerable <VenueDTO> GetAll() { var list = new List <VenueDTO>(); foreach (var item in repository.GetAll()) { list.Add(new VenueDTO { Id = item.Id, Name = item.Name, Description = item.Description, Address = item.Address, Phone = item.Phone }); } return(list); }
public GoogleAPIUtilityQueryResult Handle(GoogleAPIUtilityQuery query) { List <FIL.Contracts.Models.GoogleAPIUtility> googleAPIUtilityList = new List <FIL.Contracts.Models.GoogleAPIUtility>(); if (query.IsAll) { var city = _cityRepository.SearchByCityName(query.CityName); var venues = _venueRepository.GetAllVenueByCity(query.CityName).ToList(); foreach (FIL.Contracts.DataModels.Venue venue in venues) { FIL.Contracts.Models.GoogleAPIUtility googleAPIUtility = new FIL.Contracts.Models.GoogleAPIUtility(); var currentCity = _cityRepository.Get(venue.CityId); var currentState = _stateRepository.Get(currentCity.StateId); var currentCountry = _countryRepository.Get(currentState.CountryId); googleAPIUtility.VenueId = venue.Id; googleAPIUtility.Venue = venue.Name; googleAPIUtility.City = currentCity.Name; googleAPIUtility.State = currentState.Name; googleAPIUtility.Country = currentCountry.Name; googleAPIUtilityList.Add(googleAPIUtility); } } else { var venues = _venueRepository.GetAll().ToList(); for (int k = 0; k < venues.Count; k = k + 2000) { var currentVenues = venues.Skip(k).Take(2000); foreach (FIL.Contracts.DataModels.Venue venue in venues) { FIL.Contracts.Models.GoogleAPIUtility googleAPIUtility = new FIL.Contracts.Models.GoogleAPIUtility(); var currentCity = _cityRepository.Get(venue.CityId); var currentState = _stateRepository.Get(currentCity.StateId); var currentCountry = _countryRepository.Get(currentState.CountryId); googleAPIUtility.VenueId = venue.Id; googleAPIUtility.Venue = venue.Name; googleAPIUtility.City = currentCity.Name; googleAPIUtility.State = currentState.Name; googleAPIUtility.Country = currentCountry.Name; googleAPIUtilityList.Add(googleAPIUtility); } } } return(new GoogleAPIUtilityQueryResult { Venues = googleAPIUtilityList }); }
public VenueMatchQueryResult Handle(VenueMatchQuery query) { try { var venues = _venueRepository.GetAll(null).OrderByDescending(s => s.CreatedUtc); return(new VenueMatchQueryResult { Venues = AutoMapper.Mapper.Map <List <Venue> >(venues).ToList() }); } catch (Exception ex) { _logger.Log(Logging.Enums.LogCategory.Error, ex); return(new VenueMatchQueryResult { Venues = null }); } }
public IHttpActionResult Get() { return(Json(venueRepository.GetAll())); }
public IList <Venue> GetAll() { return(_venueRepository.GetAll()); }