title: How do I select a subset of items from an anonymous type IEnumerable?
body: <p>I have the following code.</p>
  
  <pre><code>MyDataContext db = MyDataContext.Create();
              bc =
                  db.BenefitCodes.Select(
                      b =&gt;
                      new
                          {
                              BenCd = b.BenCd
                              , Description = b.BenDesc
                              , BenInterest = b.BenInterest
                              , CodeDescription = string.Format("{0} - {1}", b.BenCd, b.BenDesc)
                          });
  </code></pre>
  
  <p>I had to go the Anonymous type route as CodeDescription isn't a property of benefitCode and the customer wants it to appear this way in a dropDrownList. Anyways my question is how can I select a subset of items from this list? I need to select items based on the BenInterest attribute.</p>
  
  <p>So this returns IEnumerable, so I am trying to go this route and this is where I get stuck. My intent is to build a new IEnumerable list and set a dropdown datasource to it.</p>
  
  <pre><code> IEnumerator enumerator = BenefitCodes.GetEnumerator(); 
          while(enumerator.MoveNext())
          {
                //What can I do here to return items based on BenInterest? 
                //I basically either want items that have a BenInterest of 'E'
                // or items that DO NOT have a BenInterest of 'E'
                // this is based on the value of a radioButtonList on the page
          }
  </code></pre>
  
  <p>So how do I create a new Enumerable of the same Anonymous type that only contains the desired items.</p>
  
  <p>Thanks for any help.
  Cheers,
  ~ck</p>