public IActionResult Get(string tripName) { try { var trip = _repository.GetTripByName(tripName); return(Ok(Mapper.Map <IEnumerable <StopViewModel> >(trip.Stops.OrderBy(s => s.Order).ToList()))); } catch (Exception ex) { _logger.LogError("Failed to get stops: {0}", ex); } return(BadRequest("Failed to get stops")); }