title: Join statement for a list
body: <p>I have a table in C# and ASP.net that references a list of another table where several vehicle registrants are mapped to a single vehicle. I do not want to go through the whole collection of vehicle registrants by accessing their individual members (e.g. <code>vehicleRegistrantsAlias[0]</code>), because I do not know how many there will be.</p>
  
  <p>Do I need to do this in two queries? I really would like to do it all in one. I have the parent class as vehicle and a child collection of vehicle registrants. Vehicle registrant is a base type and under a vehicle registrant is the owner and operator. I also want to pull information form other child tables. I am joining from vehicle to vehicleRegistrants which works fine; however, I also want to pull owner and operant.</p>
  
  <pre><code>Vehicle vehicleAlias = null;
  List&lt;VehicleRegistration&gt; vehicleRegistrationsAlias = null; 
  List&lt;VehicleRegistrant&gt; vehicleRegistrantsAlias = null; 
  
  .JoinAlias(() =&gt; vehicleAlias.VehicleRegistrations, () =&gt; vehicleRegistrationsAlias)
  .JoinAlias(() =&gt; vehicleAlias.VehicleRegistrants, () =&gt; vehicleRegistrantsAlias)
  
  //from vehicle registrants
  .JoinAlias(() =&gt; vehicleRegistrantsAlias[0]., () =&gt; vehicleSuspensionTypeAlias)
  </code></pre>