First of, the standard spec for OData response looks like:
{
"d" : {
"results": [
{
"__metadata": {
"uri": "http://demos/Orders(10248)",
"type": "SampleModel.Order"
},
"ProductId": 10248,
"Name": "Vgnon"
}
],
"__count": "1"
}
}
But, in Web API (using EntitySetController), the OData response looks like:
{
"odata.metadata":"http://localhost:43111/api/$metadata#Products",
"odata.count":"1",
"value":
[
{
"ProductId":2,
"CreatedDate":"2013-06-10T23:53:26",
"CreatedBy":0,"Name":"Camera"
}
]
}
Notice the count in both response. Does Web API follow OData standard specs?
Also, as pointed out by this SO question: Web API OData Inlinecount not working The answer says something like:
$inlinecount out of the box only works when you're sending back OData responses.
Does that mean in Web API (using either EntitySetController or ODataController) we can return OData response and non-OData response? Or should I say, Standard OData response and non-standard OData response?