title: When using Linq's GROUP BY to create a list of groups, how can I select a specific group by its key?
body: <p>What I'm trying to do here is to create a list of groups based on the first letter of a book's title, then display all the books in the group below each particular letter. So for example, if the current letter was "C" I would want to select the group where its key was also "C".  I thought running a query to create the groups would be more efficient than running a query for each letter, but I'm running in problems.</p>
  
  <p>Here's how I create the group (sorry for the VB) (Model is defined as IEnumerable(of Book):</p>
  
  <pre><code>Dim TitleGroups = From Bk In Model Group Bk By Bk.FirstLetter Into Group Order By FirstLetter
  </code></pre>
  
  <p>If I then take TitleGroups and iterate through it, everything works fine:</p>
  
  <pre><code>For Each Grp In TitleGroups
      Resposnse.Write(Grp.FirstLetter &amp; "&lt;br/&gt;")
  
      For Each Bk In Grp.Group
          Response.Write(Bk.Title &amp; "&lt;br/&gt;")
      Next
  Next
  </code></pre>
  
  <p>But if I try to select a group, it doesn't work:</p>
  
  <pre><code>Dim CurrentGroup = From Grp In TitleGroups Where Grp.FirstLetter = "A" Select Grp
  </code></pre>
  
  <p>I can't seem to work with any of the properties I expect on CurrentGroup.  I have also tried "Select Grp.Group", which also doesn't seem to help.</p>
  
  <p>Any suggestions would be appreciated!</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>em's answer below proved correct, but I thought I'd share the code after translation to VB (don't judge me):</p>
  
  <pre><code>Dim TitleGroups = From Bk In Model _
                    Order By Bk.FirstLetter _
                    Group Bk By Bk.FirstLetter Into Books = Group, BkGrp = AsEnumerable() _
                    Select FirstLetter, Books
  
  Dim CurrentGroup = From Grp In TitleGroups _
                     Where Grp.FirstLetter = "A" _
                     Select Grp
  
  For Each Grp In CurrentGroup
      Response.Write(Grp.FirstLetter &amp; "&lt;br/&gt;")
  
      For Each Book In Grp.Books
          Response.Write(Bk.Title &amp; "&lt;br/&gt;")
      Next
  Next
  </code></pre>