//[ProducesResponseType(400)]
        public IActionResult GetNationalParks()
        {
            var parks    = _npRepo.GetNationalParks();
            var parkDtos = _mapper.Map <List <NationalParkDto> >(parks);

            return(Ok(parkDtos));
        }
        public IActionResult GetNationalParks()
        {
            var obj    = _npRepo.GetNationalParks().FirstOrDefault();
            var objDto = _mapper.Map <NationalParkDto>(obj);

            return(Ok(objDto));
        }
        public IActionResult GetNationalParks()
        {
            var parks       = _npRepository.GetNationalParks();
            var mappedParks = _mapper.Map <ICollection <NationalParkDto> >(parks);

            return(Ok(mappedParks));
        }
        public IActionResult GetNationalParks()
        {
            var listObjects = _nationalParkRepository.GetNationalParks();
            var listDtos    = _mapper.Map <List <NationalParkDto> >(listObjects);

            return(Ok(listDtos));
        }
Example #5
0
        //[ProducesResponseType(400)]
        public IActionResult GetNationalParks()
        {
            var allNationalParks = _npRepo.GetNationalParks();
            var result           = allNationalParks.Select(nationalPark => _mapper.Map <NationalPark>(nationalPark));

            return(Ok(result));
        }
        public IActionResult GetNationalParks()
        {
            var domainObjects = _repository.GetNationalParks();
            var dtoItems      = _mapper.Map <IEnumerable <NationalParkDto> >(domainObjects);

            return(Ok(dtoItems));
        }
        public IActionResult GetNationalParks()
        {
            var nationalPark = _nationalParkRepo.GetNationalParks().FirstOrDefault();

            //var objDto = new NationalParkDTO();
            return(Ok(_mapper.Map <NationalParkDTO>(nationalPark)));
        }
Example #8
0
        public IActionResult GetNationalParks()
        {
            var obj = nationalParkRepository.GetNationalParks().FirstOrDefault();



            return(Ok(mapper.Map <NationalParkDto>(obj)));
        }
Example #9
0
        public IActionResult GetNationalParks()
        {
            var nationalParks    = _npRepo.GetNationalParks();
            var nationalParksDto = nationalParks
                                   .Select(nationalPark => _mapper.Map <NationalParkDto>(nationalPark))
                                   .ToList();

            return(Ok(nationalParksDto));
        }
Example #10
0
        public IActionResult GetNationalParks()
        {
            var list    = _npRepo.GetNationalParks();
            var listDto = new List <NationalParkDto>();

            foreach (var park in list)
            {
                listDto.Add(_mapper.Map <NationalParkDto>(park));
            }
            return(Ok(listDto));
        }
Example #11
0
        public IActionResult GetNationalParks()
        {
            var nationalParkObj    = _nationalParkRepository.GetNationalParks();
            var nationalParkObjDto = new List <NationalParkDto>();

            foreach (var obj in nationalParkObj)
            {
                nationalParkObjDto.Add(_mapper.Map <NationalParkDto>(obj));
            }
            return(Ok(nationalParkObjDto));
        }
        public IActionResult GetNationalParks()
        {
            var parks    = _npRepository.GetNationalParks();
            var parksDto = new List <NationalParkDto>();

            foreach (var park in parks)
            {
                parksDto.Add(_mapper.Map <NationalParkDto>(park));
            }
            return(Ok(parksDto));
        }
Example #13
0
        public IActionResult GetNationalParks()
        {
            var objList = _nationalParkRepository.GetNationalParks();
            var objDTO  = new List <NationalParkDTO>();

            foreach (var obj in objList)
            {
                objDTO.Add(_mapper.Map <NationalParkDTO>(obj));
            }
            return(Ok(objDTO));
        }
Example #14
0
        public IActionResult GetNationalParks()
        {
            var obj = _nationalParkRepository.GetNationalParks().FirstOrDefault();

            //var nationalParkObjDto = new List<NationalParkDto>();
            //foreach (var obj in nationalParkObj)
            //{
            //    nationalParkObjDto.Add(_mapper.Map<NationalParkDto>(obj));
            //}
            return(Ok(_mapper.Map <NationalParkDto>(obj)));
        }
        public IActionResult GetNationalParks()
        {
            var parks = _npRepository.GetNationalParks().Select(x =>
            {
                x.Name += " V2";
                return(x);
            });
            var mappedParks = _mapper.Map <ICollection <NationalParkDto> >(parks);

            return(Ok(mappedParks));
        }
Example #16
0
        public IActionResult GetNationalParks()
        {
            var objList = _npRepo.GetNationalParks();
            var objDto  = new List <NationalParkDto>();

            foreach (var obj in objList)
            {
                objDto.Add(_mapper.Map <NationalParkDto>(obj));
            }
            return(Ok(objDto));
        }
Example #17
0
        public async Task <IActionResult> GetNationalParks()
        {
            var nationalParkList = await _repo.GetNationalParks();

            var objDTO = new List <NationalParkDTO>();

            foreach (var item in nationalParkList)
            {
                objDTO.Add(_mapper.Map <NationalParkDTO>(item));
            }
            return(Ok(objDTO));
        }
Example #18
0
        public IActionResult GetNationalParks()
        {
            //return Ok(nationalParkRepository.GetNationalParks());

            var modelDto = new List <Parky.API.Models.DTOs.NationalParkDTO>();

            var data = nationalParkRepository.GetNationalParks().FirstOrDefault();

            var model = mapper.Map <NationalParkDTO>(data);

            return(Ok(model));
        }
Example #19
0
        public IActionResult GetNationalParks()
        {
            var objList = _npRepo.GetNationalParks().FirstOrDefault();

            //var objDto = new List<NationalParkDto>();

            //foreach(var obj in objList)
            //{
            //	objDto.Add(_mapper.Map<NationalParkDto>(obj));
            //}
            return(Ok(_mapper.Map <NationalParkDto>(objList)));
        }
Example #20
0
        public IActionResult GetNationalParks()
        {
            var nationalParkList    = npRepository.GetNationalParks();
            var nationalParkDTOList = new List <NationalParkDTO>();

            foreach (var obj in nationalParkList)
            {
                nationalParkDTOList.Add(mapper.Map <NationalParkDTO>(obj));
            }

            return(Ok(nationalParkDTOList));
        }
Example #21
0
        public ActionResult GetAllNationalParks()
        {
            var objList = _npRepo.GetNationalParks();

            var objTdoList = new List <NationalParkDto>();

            foreach (var nationalPark in objList)
            {
                objTdoList.Add(_mapper.Map <NationalParkDto>(nationalPark));
            }
            return(Ok(objTdoList));
        }
        public IActionResult GetNationalParks()
        {
            var nationalParks = _nationalParkRepo.GetNationalParks();
            var objDto        = new List <NationalParkDTO>();

            foreach (var nPark in nationalParks)
            {
                objDto.Add(_mapper.Map <NationalParkDTO>(nPark));
            }

            return(Ok(objDto));
        }
        public IActionResult GetAllNationalParks()
        {
            var objFromBD = _npRepo.GetNationalParks();

            var listOfNpRepo = new List <NationalParkDto>();


            foreach (var list in objFromBD)
            {
                listOfNpRepo.Add(_newParky.Map <NationalParkDto>(list));
            }
            return(Ok());
        }
        public IActionResult GetNationalParks()
        {
            var nationalParks = _repo.GetNationalParks();

            var nationalParksDtos = new List <NationalParkDto>();

            foreach (var obj in nationalParks)
            {
                nationalParksDtos.Add(_mapper.Map <NationalParkDto>(obj));
            }

            return(Ok(nationalParksDtos));
        }
        public IActionResult GetNationalParks()
        {
            var objList = nationalParkRepository.GetNationalParks();

            var objDto = new List <NationalParkDto>();

            foreach (var item in objList)
            {
                objDto.Add(mapper.Map <NationalParkDto>(item));
            }

            return(Ok(objDto));
        }
        public IActionResult GetNationalParks()
        {
            var objList = _npRepo.GetNationalParks();
            // never expose domain model; convert to DTOs
            var objDTO = new List <NationalParkDTO>();

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

            return(Ok(objDTO));
        }
        public async Task <IActionResult> GetNationalParks()
        {
            var parks = await _repo.GetNationalParks();

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

            var parksDto = _mapper.Map <ICollection <NationalParkDto> >(parks);

            return(Ok(parksDto));
        }
        public IActionResult GetNationalParks()
        {
            var objList = _npRepo.GetNationalParks();

            var objDTO = new List <NationalParkDTO>();

            foreach (var item in objList)
            {
                objDTO.Add(_mapper.Map <NationalParkDTO>(item));
            }


            return(Ok(objDTO));
        }
Example #29
0
        public IActionResult GetNationalParks()
        {
            var objList = _nationalParkRepository.GetNationalParks();

            var objDto = new List <NationalParkDto>();

            // nampilin objDto dan menyembunyikan model aslinya(doamin model)
            foreach (var obj in objList)
            {
                objDto.Add(_mapper.Map <NationalParkDto>(obj));
            }

            return(Ok(objDto));
        }
        public IActionResult GetNationalParks()
        {
            //return Ok(nationalParkRepository.GetNationalParks());

            var modelDto = new List <Parky.API.Models.DTOs.NationalParkDTO>();

            var data = nationalParkRepository.GetNationalParks();

            foreach (var item in data)
            {
                modelDto.Add(mapper.Map <NationalParkDTO>(item));
            }

            return(Ok(modelDto));
        }