How to get GET parameters with ASP.NET MVC ApiController

后端 未结 8 1356
挽巷
挽巷 2021-01-07 16:54

I feel a bit absurd asking this but I can\'t find a way to get parameters for a get request at /api/foo?sort=name for instance.

In the ApiControll

8条回答
  •  南笙
    南笙 (楼主)
    2021-01-07 17:45

    You're trying to build an OData webservice? If so, just return an IQueryable, and the Web API will do the rest.

提交回复
热议问题