title: How to convert given data into IEnumerable object
body: <p>I have below code in c# 4, where I am trying to use linq for ordering, grouping.</p>
  <pre><code>IList&lt;Component&gt; components = Component.OrganizationalItem.OrganizationalItem.Components(true);
  IEnumerable&lt;Component&gt; baggage = components.Where(x =&gt; x.IsBasedOnSchema(Constants.Schemas.BaggageAllowance.ToString()))
                                             .OrderBy(x =&gt; x.ComponentValue(&quot;name&quot;).StringValue(&quot;Code&quot;)) 
                                             .GroupBy(x =&gt; x.ComponentValue(&quot;name&quot;).StringValue(&quot;Code&quot;)); 
  </code></pre>
  <p>In above sample when I am trying to use <code>GroupBy</code> it is giving error, please see below:</p>
  <blockquote>
  <p>Cannot implicitly convert type '<code>System.Collections.Generic.IEnumerable&lt;System.Linq.IGrouping&lt;string,Tridion.ContentManager.ContentManagement.Component&gt;&gt;</code>' to '<code>System.Collections.Generic.IEnumerable&lt;Tridion.ContentManager.ContentManagement.Component&gt;</code>'. An explicit conversion exists (are you missing a cast?)*</p>
  </blockquote>