示例#1
0
        public IActionResult GetTraveler(string id)
        {
            var travelerFromRepo = _libraryRepository.GetTraveler(id);



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

            Models.TravelerDto traveler = CustomMapper.TravelerRepoToTravelerUI(travelerFromRepo);

            return(Ok(traveler));
        }
示例#2
0
        public ActionResult <IEnumerable <string> > ListTrips(string travelerId)
        {
            if (!travelerRepository.TravelerExists(travelerId))
            {
                return(NotFound());
            }

            var usuario       = travelerRepository.GetTraveler(travelerId);
            var tripsFromRepo = TripsRepository.ListTrips(usuario.Id);

            return(Ok(tripsFromRepo)); //Retonar un codigo 200
        }