title: Query nested linked lists
body: <p>I'm trying to query a nested linked list where result is the product of a child value multiplied by values in the parent list, and then the result is added.</p>
  
  <p>This code works:</p>
  
  <pre><code>var X = (from B in Main.Globals.BookLL
                      from G in B.GreeksLL
                      where B.DealNo == 1 &amp;&amp; B.Strategy == "Condor" &amp;&amp;
                      G.BookOrComp == "Book" &amp;&amp; G.GreekType == "Delta"
                      select new
                      {
                          Total = G.Data[3] * B.BookPosn * B.FxRate
                      }).Sum(s=&gt;s.Total);
  </code></pre>
  
  <p>...but I'd prefer to use lambda. This code below gives the compile error shown as a comment at the end of the line.</p>
  
  <pre><code>double Z = Globals.BookLL.Where(B =&gt; B.DealNo == 1 &amp;&amp; B.Strategy == "Condor").
              SelectMany(G =&gt; G.GreeksLL).
              Where(G =&gt; G.BookOrComp == "Book" &amp;&amp; G.GreekType == "Delta").
              Select(G =&gt; new { Total = G.Data[3] * B.BookPosn*B.FxRate }).           // Compile error "B does not exist in the current context"
              Sum();
  </code></pre>
  
  <p>I don't know how to do this, please take a look and correct the query? Thanks.</p>