// GET api/<controller> public async Task <IHttpActionResult> Get() { try { var result = await _flightsProcessor.GetAll(); if (result != null) { return(Ok(result)); } else { return(NotFound()); } } catch (BusinessLayerException ex) { var errors = default(string); foreach (var item in ex.Errors) { errors += item; } return(BadRequest(errors)); } }
// GET: Flights public async Task <ViewResult> Index() { var flights = await _flightsProcessor.GetAll(); return(View(flights)); }