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

前端 未结 2 2002
别跟我提以往
别跟我提以往 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:55

    This was recently fixed with the release of version 5.7 (@odata.count is now returned for collections of complex types). More info here: https://github.com/OData/WebApi/issues/484#issuecomment-153929767

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题