Example #1
0
        public IActionResult GetCity(int id, bool includePointsOfInterest = false)
        {
            var city = _repository.GetCity(id, includePointsOfInterest);

            if (city == null)
            {
                return(NotFound());
            }

            if (includePointsOfInterest)
            {
                var cityResult = Mapper.Map <CityDTO>(city);
                return(Ok(cityResult));
            }

            var cityWithoutPointsOfInterestResult = Mapper.Map <CityWithoutPointsOfInterestDto>(city);

            return(Ok(cityWithoutPointsOfInterestResult));
        }