title: Entity Framework returns incorrect data from SQL Server view
body: <p>I have a SQL Server database that contains a view.</p>
  
  <p>When I execute this query: </p>
  
  <pre><code>select * 
  from HistoryListingView 
  order by RequestTime desc`
  </code></pre>
  
  <p>I obtain this result: </p>
  
  <p><a href="https://i.stack.imgur.com/dfq8I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dfq8I.png" alt="4 Row Query Result"></a></p>
  
  <p>But, in my controller (in an ASP.NET MVC application), I only perform this code: </p>
  
  <pre><code>return Ok(_db.HistoryListingViews.OrderByDescending(r =&gt; r.RequestTime));
  </code></pre>
  
  <p>And the data received doesn't correspond; more precisely the column <code>DataType</code> is incorrect in row 2 and 4, all others columns seem to be correct.</p>
  
  <pre><code>[  
     {  
        "dataType":"Type de stationnement",
        "actionType":"Obtenir plusieurs entrées",
        "requestTime":"2017-10-26T23:06:43.81",
        "username":"admin",
        "jsonParameters":"[]",
        "error":null,
        "userSessionRequestErrorId":null
     },
     {  
        "dataType":"Type de stationnement",
        "actionType":"Obtenir plusieurs entrées",
        "requestTime":"2017-10-26T23:06:43.81",
        "username":"admin",
        "jsonParameters":"[]",
        "error":null,
        "userSessionRequestErrorId":null
     },
     {  
        "dataType":"Local",
        "actionType":"Obtenir plusieurs entrées",
        "requestTime":"2017-10-26T23:06:42.687",
        "username":"admin",
        "jsonParameters":"[]",
        "error":null,
        "userSessionRequestErrorId":null
     },
     {  
        "dataType":"Local",
        "actionType":"Obtenir plusieurs entrées",
        "requestTime":"2017-10-26T23:06:42.687",
        "username":"admin",
        "jsonParameters":"[]",
        "error":null,
        "userSessionRequestErrorId":null
     }
  ]
  </code></pre>
  
  <p>My context is configured with disabled lazyLoading and disabled ProxyCreation, and my JsonFormatter (Newtonsoft) is using basic settings: </p>
  
  <pre><code>CamelCasePropertyNamesContractResolver
  </code></pre>
  
  <p>and </p>
  
  <pre><code>ReferenceLoopHandling.Ignore
  </code></pre>
  
  <p>I can't see what can change the data. Is there something like records recycle to get better performance?</p>