Пример #1
0
        public IEnumerable <Route> Get(RouteParameters parameters)
        {
            string routeName = RouteHelper.GetTrainRouteString(parameters.Route);

            _RouteDataSource.AddParameter("rt", routeName);
            _RouteDataSource.AddParameter("key", _APIKey);

            var data  = _RouteDataSource.Execute();
            var route = _RouteConverter.Convert(data, "ctatt");

            //Inject dependencies.
            //Todo: must be a cleaner way to do this
            foreach (var routeToInject in route)
            {
                routeToInject.EndPoint = this;
            }

            return(route);
        }