Passing parameters to an OData (GET) method which returns a collection

前端 未结 2 2006
别跟我提以往
别跟我提以往 2021-01-27 01:18

I am using OData v3. How do I pass a parameter to an OData controller and return a collection? Example of what I am trying to do:



        
2条回答
  •  故里飘歌
    2021-01-27 01:58

    Try this sample, CheckoutMany method take parameter and return a collection https://github.com/OData/ODataSamples/tree/master/WebApi/v3/ODataActionsSample

    Add [EnableQuery] attribute in the CheckOutMany action method, and add $inlinecount queryoption in requset url, you can see odata.count in payload

    By the way, V4 support datetime now: http://odata.github.io/WebApi/#04-01-datetime-support

提交回复
热议问题