Esempio n. 1
0
        public async Task CalcRoutesAsync(IRouteService routeService, Local depot)
        {
            var from = depot;

            Routes = new List <Rota>();
            Rota route;

            foreach (var next in Locals)
            {
                route = await routeService.GetRouteAsync(from, next);

                Routes.Add(route);
                from = next;
            }

            if (Locals.Any())
            {
                DepotBack = await routeService.GetRouteAsync(Locals.Last(), depot);
            }
        }