public FlightViewModel GetById(string id) { int decryptedId = _hashidService.Decrypt(id); Flight flight = _flightRpository.GetById(decryptedId); return(new FlightViewModel { DeparturePoint = flight.DeparturePoint, DepartureTime = flight.DepartureTime, ArrivalPoint = flight.ArrivalPoint, ArrivalTime = flight.ArrivalTime }); }
public TripViewModel GetById(string id) { var decryptedId = _hashIdsService.Decrypt(id); Trip trip = _tripRepository.GetById(decryptedId); return(new TripViewModel { Departure = trip.Departure, DepartureTerminal = trip.DepartureTerminal, DepartureDay = trip.DepartureDay, DepartureTime = trip.DepartureTime, Arrival = trip.Arrival, ArrivalTerminal = trip.ArrivalTerminal, ArrivalDay = trip.ArrivalDay, ArrivalTime = trip.ArrivalTime, FlightStatus = trip.FlightStatus.ToString() }); }