public ActionResult <IEnumerable <Entity> > GetByDate(string begin, string end)
 {
     try
     {
         var result = FlightRepository.GetByDate(begin, end);
         return(Ok(result.ToList()));
     }
     catch (DbErrorException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #2
0
        public void GetByDateFlightTest()
        {
            List <Entity> flights = FlightRepository.GetByDate("12-11-2020", "12-30-2020");

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