title: Linq query to find a match where nested list contains sequence
body: <p>Given these two objects:</p>
  
  <pre><code>public class Foo{
     public string Result {get;set;}
     public List&lt;Bar&gt; Bars {get;set;}
  }
  
  public class Bar{
     public string Left {get;set;}
     public string Right {get;set;}
  }
  </code></pre>
  
  <p>And instances of these looking like this:</p>
  
  <pre><code>List&lt;Foo&gt; myFoos = new List&lt;Foo&gt;()
          {
      new Foo { Bars = new List&lt;Bar&gt;
          {
              new Bar { Left = "myLeft1", Right = "myValue1"},
              new Bar { Left = "myLeft2", Right = "myValue2"}
          },
          Result = "TheWinningResult"},
      new Foo { Bars = new List&lt;Bar&gt;
          {
              new Bar { Left = "myLeft2", Right = "myValue2"},
              new Bar { Left = "myLeft3", Right = "myValue3"}
          },
          Result = "TheLosingResult"},
      new Foo{ Bars = new List&lt;Bar&gt;
          {
              new Bar { Left = "myLeft1", Right = "myValue1"},
              new Bar { Left = "myLeft2", Right = "myValue2"},
              new Bar { Left = "myLeft3", Right = "myValue3"}
          },
          Result = "TheOtherLosingResult"},
  };
  
  List&lt;Bar&gt; bars = new List&lt;Bar&gt;()
  {
       new Bar{  Left = "myLeft1", Right = "myValue1" },
       new Bar{  Left = "myLeft2", Right = "myValue2" }
  };
  </code></pre>
  
  <p>I am trying to find the <code>FirstOrDefault()</code> <code>Foo</code> where <code>Foo.Bars</code> has an exact matching <code>bars</code></p>
  
  <p>In this case, I am trying to return the <code>Foo</code> whos <code>Result</code> is "TheWinningResult"</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>Foo foo =  myFoos.Where(t =&gt; t.Bars.All(t2 =&gt; bars.Contains(t2))).FirstOrDefault();
  
  Foo foo = myFoos.Where(t =&gt; bars.All(r =&gt; t.Bars.Contains(r))).FirstOrDefault();     
  
  Foo foo =   myFoos.FirstOrDefault(t =&gt; t.Bars.Any(r =&gt; bars.All(ru =&gt; ru.Left == r.Left &amp;&amp; ru.Right == r.Right)));
  </code></pre>
  
  <p>Any idea where I am going wrong?</p>
  
  <p><em>Update</em></p>
  
  <p>I forgot to mention, Order of the <code>Bars</code> within <code>Foo</code> should not matter.</p>