[英]Limit serverside results from WebApi controller and ODATA w/ Nhibernate
[英]odata and webapi together in the same controller
我有ticketController
public class ticketsController : ODataController
{
}
是否有可能:
GET /api/tickets?$skip={record_to_skip}&$top={pageSize}
GET /api/tickets/{id}
PUT /api/tickets/{id}
DELETE /api/request/{id}
第一個GET方法使用odata路由,第二個GET,PUT和POST使用web api路由
謝謝
是的,但是您必須使用OData屬性。 您的控制器應繼承自ApiController而不是ODataController,並且您要查詢的方法/操作使用OData'Qeryable'屬性繪制它,請查看此內容以獲取更多詳細信息:
此外,如果您搜索OData可查詢屬性,您應該獲得一大堆信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.