I have 3 collection : teams, routes, waypoints
Teams may have many routes, routes may have many waypoints
I want take collection of teams, every item of team must have collection routes, every route must have collection waypoints.
I know how is do for two collections. It is my query
var waypoints = from team in teams
join route in Routes on team.TeamID equals route.TeamID
into rList
select new { teamName= team.teamName, Rlist = rList};
foreach (var t in waypoints)
{
Console.WriteLine("<{0} team>:", t.teamName);
foreach (var m in t.Rlist)
Console.WriteLine(" " + m.RouteName);
Console.WriteLine();
}
How I Can connect third join WayPoints ?
I want to get like this result
{
team_1-> route_1->waypoint_1
waypoint_3
waypoint_5
team_2-> route_2->waypoint_4
waypoint_5
waypoint_9
team_4-> route_5->waypoint_5
waypoint_7
waypoint_8
}