Пример #1
0
        public IActionResult GetAll(string tripName)
        {
            try
            {
                var trip  = _repository.GetTripByName(tripName);
                var stops = trip.Stops.OrderBy(s => s.Order).ToList();

                return(Ok(Mapper.Map <IEnumerable <StopViewModel> >(stops)));
            }
            catch (Exception ex)
            {
                _logger.LogError("Failed to get stops for trip {0}: {1}", tripName, ex);
            }

            return(BadRequest("Unable to complete request"));
        }