public ActionResult <IEnumerable <Entity> > GetByLocation(int departure, int arrival)
 {
     try
     {
         var result = FlightRepository.GetByLocation(departure, arrival);
         return(Ok(result.ToList()));
     }
     catch (DbErrorException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #2
0
        public void GetByLocationFlightTest()
        {
            List <Entity> flights = FlightRepository.GetByLocation(testflight.loc_departure.Id, testflight.loc_arrival.Id);

            Assert.True(flights.Count() > 0);
        }