title: Nerd Dinner pagginated list - how do I add a linq orderby clause dynamicaly? ANYONE?
body: <p>I have implemented nerd dinner method of paging- which works great. But I want to be able to dynamically be able to order by certian fields.</p>
  
  <p>How would I go about implementing this. Here is my code?</p>
  
  <p>Controller:</p>
  
  <pre><code> PaginatedList&lt;Classifieds_Ads&gt; pageOfClassifieds = new PaginatedList&lt;Classifieds_Ads&gt;(classifiedsRepositry.GetClassifiedsInCategory(category), paging, 20);
  </code></pre>
  
  <p>Repository:</p>
  
  <pre><code>    return from classifieds in context.Classifieds_Ads.Include("User")
             where (from catergory in context.Classifieds_Categories
                    where catergory.MVC_URL == MVC_Cat 
                    select catergory).Contains(classifieds.Classifieds_Categories)
              orderby classifieds.DatePosted descending
             select classifieds;
  </code></pre>
  
  <p>As you can see I have the orderby clause "hard coded" into my repository. I just don't know the code to implement it dynamically?</p>
  
  <p>Anybody have any ideas?</p>
  
  <p>Thanks,</p>