title: Entity Framework SQL query string to get history data from temporal tables throwing a data-table incompatible error
body: <p>I had same problem explained in <a href="https://stackoverflow.com/questions/40742142/entity-framework-not-working-with-temporal-table">this</a> question.</p>
  
  <p>Found a great answer by <a href="https://stackoverflow.com/users/64734/matt-ruwe">Matt</a> in the same post which helped me a lot. It works for insert and update queries. I'm using IDbCommandTreeInterceptor and Ignored ValidFrom and ValidTo columns.</p>
  
  <p>Now I'm trying to query some history data. As Entity Framework Linq queries cant get data from temporal tables, I'm forced to used SQL query string.</p>
  
  <pre><code>var result = this.Context.VehicleSets.SqlQuery("SELECT Id, Name FROM T.VehicleSet FOR SYSTEM_TIME ALL WHERE Id = 1").ToList();
  </code></pre>
  
  <p>This line throws an error in run-time.</p>
  
  <pre><code>The data reader is incompatible with the specified 'Model.VehicleSet'. A member of the type, 'ValidFrom', does not have a corresponding column in the data reader with the same name.
  </code></pre>
  
  <p>Matt in his answer has set clause for insert and update commands.
  I tried using DbQueryCommandTree to set same clause for querying, but DbQueryCommandTree doesn't have SetClauses command.</p>
  
  <p>Any help will be very much appreciated.</p>