title: Joining parent and child collection in LINQ for a single merged output
body: <p>I have a collection of items which each contain a secondary collection. I need to generate a list of new items based off the total set of secondary items. Eg if you have a list of dogs and each dog has a list of friends, I need a total list of all dog friends for all dogs. </p>
  
  <p>Normally I would do this with SelectMany but the difficulty here is my secondary objects do not contain a reference back to the parent object, and the new list needs to contain fields from both secondary and parent objects. ie as below</p>
  
  <pre><code>var dogs = List&lt;Dog&gt;
  var newList = dogs.SelectMany(i =&gt; i.DogFriends).Select(dogFriend =&gt; new NewObject
              {
                  fieldOne = dog.propertyOne,
                  fieldTwo = dog.propertyTwo
                  fieldThree = dogFriend.propertyOne
              });
  </code></pre>
  
  <p>In the above, I have no reference to dog however, so I cannot select those.</p>
  
  <p>What I'm looking for is a way to do a join on the two tables as in SQL, so you can select values from both objects. But I want the total values to match the total number of child objects. Ie if you have 3 dogs with 3 friends each, the final list will have 9 objects.</p>
  
  <p>How can I achieve this with LINQ?</p>