title: Sort Inner Repeater with LINQ query
body: <p>I am attempting to list a group of Associations, within each association is a 'widget' that is assigned to the association.  The list will include the Association name and any widget assigned to it. The catch is that the inner widget list needs to be sorted by DisplaySequence.</p>
  
  <p><strong>EDMX Model Below:</strong>
  <img src="https://i.stack.imgur.com/NqZbi.png" alt="EDMX Model"></p>
  
  <p><strong>Simplified Repeater Mark-Up</strong></p>
  
  <pre><code>&lt;asp:Repeater ID="rptAssociations" runat="server"&gt;
      &lt;ItemTemplate&gt;      
          &lt;div data-type="assn" id="&lt;%# ((Association)Container.DataItem).AssociationID %&gt;"&gt;
              &lt;h3 style="margin-top:15px;"&gt;&lt;%# ((Association)Container.DataItem).Acronym %&gt; - &lt;%# ((Association)Container.DataItem).Name %&gt;&lt;/h3&gt; 
              &lt;asp:Repeater runat="server" ID="rptWidgets" DataSource="&lt;%# ((Association)Container.DataItem).AssociationWidgets %&gt;" &gt;
                  &lt;HeaderTemplate&gt;                
                      &lt;ul class="WidgetList"&gt;
                  &lt;/HeaderTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;li id="&lt;%# ((AssociationWidget)Container.DataItem).DisplaySequence %&gt;"&gt;&lt;%# ((AssociationWidget)Container.DataItem).Widget.Name %&gt;&lt;/li&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;FooterTemplate&gt;
                      &lt;/ul&gt;
                  &lt;/FooterTemplate&gt;
              &lt;/asp:Repeater&gt;
          &lt;/div&gt;      
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p><strong>Current Query</strong></p>
  
  <pre><code>var associations = (from a in 
      context.Associations.Include("AssociationWidgets")
                          .Include("AssociationWidgets.Widget")
      orderby a.Acronym
      select a).ToList();
  
  rptAssociations.DataSource = associations;
  rptAssociations.DataBind();
  </code></pre>
  
  <p>I am currently able to get the data that I'm looking for with the setup that I have now.  I am looking for the most efficient approach to getting this same data, however, having the Widgets listed in the correct display order.</p>
  
  <p>Is there a different approach to the linq query I should take?  </p>