Esempio n. 1
0
        public IEnumerable <RouteDto> GetRoutes(RouteDto routeDto, string email)
        {
            List <RouteDto> routes = _routeLogic.GetRoutes(routeDto, email);

            foreach (RouteDto route in routes)
            {
                AddDriversNamesToRouteRides(route.Rides);
            }
            return(routes);
        }
Esempio n. 2
0
        public async Task <IEnumerable <RouteDto> > GetRoutesAsync(RouteDto routeDto, string email)
        {
            List <RouteDto> routes = _routeLogic.GetRoutes(routeDto, email);

            foreach (RouteDto route in routes)
            {
                await AddDriversNamesToRouteRidesAsync(route.Rides);
            }
            return(routes);
        }
Esempio n. 3
0
        public IEnumerable <RouteDto> GetRoutes(RouteDto routeDto, string email)
        {
            List <RouteDto> routes = _routeLogic.GetRoutes(routeDto, email);

            foreach (var route in routes)
            {
                foreach (var ride in route.Rides)
                {
                    if (IsRideRequested(ride.RideId, email))
                    {
                        ride.Requested = true;
                    }
                }
                route.Rides = route.Rides.Where(x => x.RideDateTime >= DateTime.Now).OrderBy(x => x.RideDateTime).ToList();
            }
            //   foreach (RouteDto route in routes)
            //   {
            //       AddDriversNamesToRides(route.Rides);
            //   }
            return(routes);
        }