Exemple #1
0
        public IActionResult GetCities(bool includePointsOfInterest = false)
        {
            var cityEntities = _repository.GetCities(includePointsOfInterest);

            if (includePointsOfInterest)
            {
                var citiesResult = Mapper.Map <List <CityDTO> >(cityEntities);
                return(Ok(citiesResult));
            }
            var results = Mapper.Map <IEnumerable <CityWithoutPointsOfInterestDto> >(cityEntities);

            return(Ok(results));
        }
 public async Task <ActionResult <IEnumerable <City> > > Get()
 {
     return(await rep.GetCities().ToListAsync());
 }
 public List <City> GetAllCities()
 {
     return(citiesRepository.GetCities());
 }
 public IEnumerable <CityInfo> GetCities()
 {
     return(citiesRepository.GetCities().Select(city => city.AsDto()));
 }
Exemple #5
0
 public List <City> GetCities()
 {
     return(_mapper.Map <List <City> >(_cityRepository.GetCities()));
 }
Exemple #6
0
 static Game()
 {
     _cityRepo = new SqlCeCitiesRepository();
     Cities    = _cityRepo.GetCities();
 }
 public async Task <Page <City> > Get(string term)
 {
     term ??= "";
     return(await _repo.GetCities(term, 10));;
 }