示例#1
0
        public IActionResult GetTrailsInNationalPark(int nationalParkId)
        {
            var objList      = _trailRepo.GetTrailsInaNationalPark(nationalParkId);
            var trailListDto = new List <TrailDto>();

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

            foreach (var obj in objList)
            {
                trailListDto.Add(_mapper.Map <TrailDto>(obj));
            }

            return(Ok(trailListDto));
        }