public void Post([FromBody] FlightPlan value) { if (value == null) { return; } if (value.Company_name == null || value.Initial_location == null || value.Segments == null) { return; } Plane p = new Plane(value, true, DistCalc.IdGenerator()); var ts = new List <Plane>(); ts.Add(p); FlightsSQL.Instance.SaveInternalFlights(ts); }
public void Post([FromBody] FlightPlan value) { //convert flightPlans to Plane and put in list. if (value == null) { return; } if (value.Company_name == null || value.Initial_location == null || value.Segments == null) { return; } List <Plane> planes = new List <Plane>(); var id = DistCalc.IdGenerator(); var p = new Plane(value, false, id); planes.Add(p); FlightsSQL.Instance.SaveInternalFlights(planes); return; }