public IActionResult GetTrails() { var domainObjects = _repository.GetTrails(); var dtoItems = _mapper.Map <IEnumerable <TrailDto> >(domainObjects); return(Ok(dtoItems)); }
public IActionResult GetTrails() { var listObjects = _trailRepository.GetTrails(); var listDtos = _mapper.Map <List <TrailDto> >(listObjects); return(Ok(listDtos)); }
public IActionResult GetTrails() { var trails = _trailRepository.GetTrails(); var mappedTrails = _mapper.Map <ICollection <TrailDto> >(trails); return(Ok(mappedTrails)); }
public IActionResult GetTrails() { var trails = _trailRepo.GetTrails(); var trailsDto = trails .Select(trail => _mapper.Map <TrailDto>(trail)) .ToList(); return(Ok(trailsDto)); }
public IActionResult GetTrails() { var objList = _trailRepo.GetTrails(); var objDto = new List <TrailDto>(); foreach (var obj in objList) { objDto.Add(_mapper.Map <TrailDto>(obj)); } return(Ok(objDto)); }
public IActionResult GetTrails() { var objList = _trailRepository.GetTrails(); var objDTO = new List <TrailDTO>(); foreach (var obj in objList) { objDTO.Add(_mapper.Map <TrailDTO>(obj)); } return(Ok(objDTO)); }
public IActionResult GetTrails() { var trailObj = _trailRepository.GetTrails(); var trailObjDto = new List <TrailDto>(); foreach (var obj in trailObj) { trailObjDto.Add(_mapper.Map <TrailDto>(obj)); } return(Ok(trailObjDto)); }
public IActionResult GetTrails() { var list = _repo.GetTrails(); var listDto = new List <TrailDto>(); foreach (var trail in list) { listDto.Add(_mapper.Map <TrailDto>(trail)); } return(Ok(listDto)); }
public IActionResult GetTrails() { var parks = _trailRepository.GetTrails(); var parksDto = new List <TrailDto>(); foreach (var park in parks) { parksDto.Add(_mapper.Map <TrailDto>(park)); } return(Ok(parksDto)); }
public IActionResult GetTrails() { var TrailList = trailRepository.GetTrails(); var TrailDTOList = new List <TrailDTO>(); foreach (var obj in TrailList) { TrailDTOList.Add(mapper.Map <TrailDTO>(obj)); } return(Ok(TrailDTOList)); }
public IActionResult GetTrails() { var trails = _repo.GetTrails(); var trailsDtos = new List <TrailDto>(); foreach (var obj in trails) { trailsDtos.Add(_mapper.Map <TrailDto>(obj)); } return(Ok(trailsDtos)); }
public IActionResult GetTrails() { var trails = trailRepository.GetTrails(); var trailDtos = new List <TrailDto>(); // Convert Trail object (Domain Model) to TrailDto (Dto) foreach (var trail in trails) { trailDtos.Add(mapper.Map <TrailDto>(trail)); } return(Ok(trailDtos)); }
public IActionResult GetTrails() { var objList = TrailRepository.GetTrails(); var objDto = new List <TrailsDto>(); foreach (var item in objList) { objDto.Add(mapper.Map <TrailsDto>(item)); } return(Ok(objDto)); }
public IActionResult GetTrails() { var objList = _trailRepo.GetTrails(); //This will ensure we send our Dto instead of the model var objDto = new List <TrailDto>(); foreach (var obj in objList) { objDto.Add(_mapper.Map <TrailDto>(obj)); } return(Ok(objDto)); }
public IActionResult GetAllTrails() { //return Ok(trailRepository.GetNationalParks()); var modelDto = new List <Parky.API.Models.DTOs.TrailDTO>(); var data = trailRepository.GetTrails(); foreach (var item in data) { modelDto.Add(mapper.Map <TrailDTO>(item)); } return(Ok(modelDto)); }
public IActionResult GetTrails() { var trails = _tRepository.GetTrails(); if (trails != null) { var trailDTOList = new List <TrailDTO>(); foreach (var trail in trails) { trailDTOList.Add(_mapper.Map <TrailDTO>(trail)); } return(Ok(trailDTOList)); } else { return(NotFound(new { message = "There is no data" })); } }