コード例 #1
0
ファイル: StopManager.cs プロジェクト: mchilicki/commline
        public IEnumerable <StopDTO> GetAllConnectedToAnyLine()
        {
            var stopsDTOs = Mapper.Map <IEnumerable <Stop>, IEnumerable <StopDTO> >
                                (_stopRepository.GetAllConnectedToAnyLine());

            return(stopsDTOs);
        }
コード例 #2
0
        public FastestPathDTO SearchFastestConnections(SearchInputDTO searchInputDTO)
        {
            _searchValidator.Validate(searchInputDTO);
            var searchInput        = _searchInputManualMapper.ToDomain(searchInputDTO);
            var stops              = _stopRepository.GetAllConnectedToAnyLine();
            var stopGraph          = _graphGenerator.CreateGraph(stops, searchInput.StartDate);
            var fastestConnections = _connectionSearchEngine.SearchConnections(searchInput, stopGraph);
            var fastestPath        = _fastestPathResolver.ResolveFastestPath(searchInput, fastestConnections);
            var fastestPathDTO     = Mapper.Map <FastestPath, FastestPathDTO>(fastestPath);

            fastestPathDTO.PathDescription = _fastestPathDescriptionWriter.WriteDescription(searchInput, fastestPath);
            return(fastestPathDTO);
        }