Join two lists with one to many relationship
<p>I have two classes like so.  One has a list of the other class and are linked by key1.</p>

<pre><code>public class Alpha
{
    public key1 { get; set; }
    public List&lt;Bravo&gt; { //getter and setter }
}

public class Bravo
{
    public key1 { get; set; }
    public someProp { get; set; }
}
</code></pre>

<p>I have a method that gets two lists of Alpha and Bravo and I need to join them into one list of Alpha.  Each Alpha has a one to many relationship with Bravo but now I have many Alpha.  I know I could iterate through both lists but is there a faster way?</p>

<pre><code>public List&lt;Alpha&gt; Join (List&lt;Alpha&gt; alphaList, List&lt;Bravo&gt; bravoList)
{
    //match each Bravo with it's corresponding Alpha
}
</code></pre>

<p>Example:</p>

<pre><code>alphaList = { 
    item1 { key1 = 1, bravoList { } }
    item2 { key1 = 2, bravoList { } }
    item3 { key1 = 3, bravoList { } }
}

bravoList = {
    itemA { key1 = 1, someProp }
    itemB { key1 = 2, someProp }
    itemC { key1 = 2, someProp }
    itemD { key1 = 3, someProp }
    itemE { key1 = 3, someProp }
}

finalList = {
    item1 { key1 = 1, bravoList { itemA } }
    item2 { key1 = 2, bravoList { itemB, itemC } }
    item3 { key1 = 3, bravoList { itemD, itemE } }
}
</code></pre>
