Try putting the ToList at the end of the command. Change:
}).ToList()
.Select(x => new Route()
{
RouteId = x.RouteId,
RouteName = x.RouteName,
RouteDesc = x.RouteDesc,
TripIns = x.tripins,
TripOuts = x.tripouts
});
To:
})
.Select(x => new Route()
{
RouteId = x.RouteId,
RouteName = x.RouteName,
RouteDesc = x.RouteDesc,
TripIns = x.tripins,
TripOuts = x.tripouts
}).ToList();