none
OData Response User Defined Format - Web API RRS feed

  • Question

  • We have few OData supporting Web API endpoints that return JSON response.
    The output for example: 

    @odata.context": "http://xyz:1234/api/$metadata#Entities",

        "value": [

            {

                "Id": "0000",

                "Desc": "Abc Ltd",

                "Country": "AB",

                "UpdateTimestamp": "2017-10-29T13:55:26.483+05:30"

            },

            {

                "Id": "0000",

                "Desc": "Pqr Ltd",

                "Country": "CD",

                "UpdateTimestamp": "2017-10-29T13:55:26.483+05:30"

            }

    ],

        "@odata.nextLink": "http://xyz:1234/api/Entities?$skip=50"

    }

    I need to add previous and self link along with next link. 
    I do not mind adding it like additional properties, not necessarily annotations.

    I followed the tutorial here - http://odata.github.io/WebApi/06-03-costomize-odata-formatter/ 
    But with this i am able to add annotations only to a single entity response, example - http://xyz:1234/api/Entities/1, but i need to add it for collection response.

    I am new to OData Lib, ant direction in this regard is appreciated.

    Wednesday, July 4, 2018 12:38 PM

All replies