I have a SQL Server database that contains a view.
When I execute this query:
select *
from HistoryListingView
order by RequestTime desc`
I obtain this result:
But, in my controller (in an ASP.NET MVC application), I only perform this code:
return Ok(_db.HistoryListingViews.OrderByDescending(r => r.RequestTime));
And the data received doesn't correspond; more precisely the column DataType is incorrect in row 2 and 4, all others columns seem to be correct.
[
{
"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
}
]
My context is configured with disabled lazyLoading and disabled ProxyCreation, and my JsonFormatter (Newtonsoft) is using basic settings:
CamelCasePropertyNamesContractResolver
and
ReferenceLoopHandling.Ignore
I can't see what can change the data. Is there something like records recycle to get better performance?
