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)); }
public IActionResult Detail(int trailId) { Trail trail = _repository.GetTrailById(trailId); return(View(trail)); }