title: WebAPI 2.2 - Entity Framework 6 - Odata v4 query problems and symantics
body: <p>I am attempting a prototype mobile application. The requirements are an Odata delivery mechanism, and an existing SQL Database. I built a WebAPI 2.2 web service application using visual studio. I installed Entity Framework 6 and Odata V4. It was quite simple getting it nearly fully functional. I do have one issue...</p>
  
  <p>I have a basic two SQL table backend. The Primary table has configuration elements, the secondary has daily acquired data from several systems. The secondary table has a primary key that is compound of the configid and the date descending. This allows the table to naturally sort most recent first (basic schema below). </p>
  
  <p>The WebAPI service runs great and as expected. "/odata/configs", returns all configs. "/odata/configs(1)" returns a single entity. "/odata/configs(1)/detail" returns all the appropriate detail records with most recent first... Fantastic. The one area I'm having a problem with is odata uri query that is required for paging data. Top, skip, etc do not return the correct record sets... they are returning the bottom of the dataset, as if the sql primary key order has no meaning... this is curious?</p>
  
  <p>I had read somewhere that paging may require a primary key id on the table. Is this accurate? Can someone point out where to begin looking for documentation or a solution for this issue. In addition, any insight into custom datasets, stored procedure handling with odata query etc would be helpful in the near future.  </p>
  
  <p>Primary Table: "Config"
  configid: int Primary Key
  name: varchar(50)
  more...
  Secondary Table: "Detail"
  configid: int (link to primary)
  date: datetime
  data: varchar(max)</p>
  
  <p>Thanks in advance,</p>
  
  <p>Stew Basterash</p>