public DetailFlightViewModel DetailFlight(int id) { DetailFlightViewModel DFOBJ = new DetailFlightViewModel(); try { var flightobj = _flight.FindById(Convert.ToInt32(id)); if (flightobj != null) { DFOBJ.AirportStartName = _airport.FindById(flightobj.AirPortId).Name; DFOBJ.AirportEnd = _airport.FindById(flightobj.AirPortId).Name; DFOBJ.typeName = _TypeDetail.FindById(flightobj.Id).Name; DFOBJ.Temperature = _Weatger.FindById(flightobj.Id).Temperature; DFOBJ.StartTime = flightobj.StartTimeDate; DFOBJ.EndTime = flightobj.EndTimeDate; DFOBJ.Delay = flightobj.Delay; } return(DFOBJ); } catch (Exception ex) { string Mes = ex.Message; return(DFOBJ); } }