title: Entity Framework: Automatically sorting generic DbSet by primary key
body: <p>As part of a generic repository pattern I have a <code>DbSet&lt;TEntity&gt;</code> - a generic Entity Framework <code>IQueryable</code> collection. The type of <code>TEntity</code> could vary, but I know I want to sort by whatever the primary key is.</p>
  
  <p>Can I do this generically in EF, without knowing the type in advance? Otherwise how can we do Skip() -> Take() for repeaters without knowing the type?</p>