public async Task <ActionResult <PassengerDto[]> > GetAllPassengers(bool timeTable) { try { var result = await _passengerRepository.GetPassengers(timeTable); var passengerresult = _mapper.Map <PassengerDto[]>(result).Select(m => HateoasMainLinksPassenger(m)); if (result == null) { return(NotFound("Could not find any passengers.")); } return(Ok(passengerresult)); } catch (Exception e) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database failor: {e.Message}")); } }
public IEnumerable <Passenger> GetPassengers() { return(_passengerRepository.GetPassengers().OrderBy(p => p.Seat)); }
public IList <Passenger> Get() { return(_passengerRepository.GetPassengers()); }
public ActionResult Index() { var passengers = _passengerRepository.GetPassengers(); return(View(passengers)); }