asp.net core 3.1 – OData not returning @odata.context and @odata.nextLink- Just returns result in values

We are developing OData API using (.Net Core 3.1/.Net 5.0 and OData Version 8.0.11), where we have registered DataModle with IEDM, but in the response of the API we are not getting the IEDM Contract, instead we are getting only the array of values, like shown below. Not sure if we are missing something, your help is greatly appreciated. Thanks.

[
    {
        "id": "00000000-0000-0000-0000-000000000000",
        "code": "Code1"
    },
    {
        "id": "00000000-0000-0000-0000-000000000001",
        "code": "Code2"
    }
]

But we should be getting the response in the below IEDM contract, which we are not getting!

{
    "@odata.context": "https://localhost:44338/$metadata#Event",
    "value": [
    {
    "@odata.type": "#ODataPOC.Event",
    "@odata.id": "https://localhost:44338/Event(00000000-0000-0000-0000-000000000000)",
    "@odata.editLink": "Event(00000000-0000-0000-0000-000000000000)",
    "Id@odata.type": "#Guid",
    "Id": "00000000-0000-0000-0000-000000000000"
    },
    {
    "@odata.type": "#ODataPOC.Event",
    "@odata.id": "https://localhost:44338/Event(00000000-0000-0000-0000-000000000000)",
    "@odata.editLink": "Event(00000000-0000-0000-0000-000000000001)",
    "Id@odata.type": "#Guid",
    "Id": "00000000-0000-0000-0000-000000000001"
    }
    ],
"@odata.nextLink": "https://localhost:44338/event?$skip=2"
}

Thanks!

Read more here: Source link