예제 #1
0
        public IActionResult GetFlights([FromQuery] string relative_to)
        {
            DateTime relativeTo = DateTime.Parse(relative_to,
                                                 CultureInfo.InvariantCulture,
                                                 DateTimeStyles.AdjustToUniversal);
            bool syncAll = Request != null?Request.Query.ContainsKey("sync_all") : false;

            List <Flight> flights = _flightsManager.GetRelativeFlights(relativeTo, syncAll);

            return(new OkObjectResult(JsonConvert.SerializeObject(flights, Formatting.Indented)));
        }