示例#1
0
        public List <DataManagementLink> ListActiveLinks()
        {
            var links = _linkDal.GetAll().Select(l => new DataManagementLink()
            {
                Id1 = l.Node1Id, Id2 = l.Node2Id
            }).ToList();

            return(links);
        }
        public List <int> CalculateShortestRoute(int nodeId1, int nodeId2)
        {
            var toReturn = new List <int>();
            var links    = _linkDal.GetAll().ToList();

            _calculator.Init(links.Select(l => new Tuple <int, int>(l.Node1Id, l.Node2Id)));
            var path = _calculator.CalculateShortestPath(nodeId1, nodeId2);

            if (path != null)
            {
                toReturn = path.ToList();
            }

            return(toReturn);
        }