Example #1
0
        public IActionResult GetTrailById(int trailId)
        {
            if (!_trailRepository.TrailExists(trailId))
            {
                return(NotFound());
            }

            var trail = _trailRepository.GetTrailById(trailId);

            var trailDto = _mapper.Map <Trail, TrailDto>(trail);

            return(Ok(trailDto));
        }
Example #2
0
        public IActionResult Detail(int trailId)
        {
            Trail trail = _repository.GetTrailById(trailId);

            return(View(trail));
        }