Breeze WebAPI: How to combine QueryResult with ODataQueryOptions to return inlineCount

故事扮演 提交于 2019-12-06 06:49:17

The solution appears to be:

public QueryResult TodoLists(ODataQueryOptions<TodoList> odataQueryOptions)

Fiddler:

Request:

GET /breeze/Todo/TodoLists?$top=15&$inlinecount=allpages HTTP/1.1

Response:

{"$id":"1","$type":"Breeze.WebApi.QueryResult, Breeze.WebApi","Results":[{"$id":"2","$type":"NoDb.Models.TodoList, NoDb","TodoListId":1,"Title":"Before work","Todos":[{"$id":"3","$type":"NoDb.Models.TodoItem, NoDb","TodoItemId":1,"Title":"Make coffee","IsDone":false,"TodoListId":1,"TodoList":{"$ref":"2"}},{"$id":"4","$type":"NoDb.Models.TodoItem, NoDb","TodoItemId":2,"Title":"Turn heater off","IsDone":false,"TodoListId":1,"TodoList":{"$ref":"2"}}]}],"InlineCount":1}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!