示例#1
0
        public IActionResult GetCity(int cityId, bool includePointsOfInterest)
        {
            var city = CitiesRepository.GetCity(cityId, includePointsOfInterest);

            if (!CitiesRepository.CityExists(cityId))
            {
                return(NotFound());
            }


            if (!includePointsOfInterest)
            {
                var cityWithoutPoiDTO = ToDto.ToCityWithoutPoiDto(city);

                return(new ObjectResult(cityWithoutPoiDTO));
            }

            else
            {
                var cityWithPoiDTO = ToDto.ToCityWithPoiDto(city);

                return(new ObjectResult(cityWithPoiDTO));
            }
        }