public IActionResult PassengersDetails(int id) { Reservation reservation = _reservationRepository.Items.SingleOrDefault(item => item.Id == id); if (reservation == null) { return(NotFound()); } PassengerListViewModel model = new PassengerListViewModel() { Items = reservation.Passengers.Select(pass => new Models.PassengerViewModel() { ReservationId = pass.ReservationId, FirstName = pass.FirstName, MiddleName = pass.MiddleName, LastName = pass.LastName, EGN = pass.EGN, PhoneNumber = pass.PhoneNumber, IsBusiness = pass.IsBusiness }) }; return(View(model)); }
public PassengerListPage(long journeyId) { InitializeComponent(); _journeyId = journeyId; passengerListViewModel = new PassengerListViewModel(_journeyId); }