Web API Fall Update – ODataResult<T>

Another great feature  Web API team has provided support for Server side paging and $inlineCount is called oDataResult<T>

It is really easy to achieve this. Earlier you could return the data but you will have to rely on other mechanisms to achieve $inlineCount.

Step1: Change your return type of the controller action to oDataResult<T>.

Assuming your resource is available at

http://localhost:8080/webapi/Accounts.

image1

Step2: Execute the request.

image2

Now you can get the count and a navigation path both.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s