We really need support for $inlinecount and/or $count. With no efficent way of extending web api to support this I struggle to find a way to add proper paging. I've tried all kinds of more or less nasty hacks to add this. Please add support for this or enable
a proper way for us to implement this.
We really need support for $inlinecount and/or $count. With no efficent way of extending web api to support this I struggle to find a way to add proper paging. I've tried all kinds of more or less nasty hacks to add this. Please add support for this or enable
a proper way for us to implement this.
I second this, paging features should just be removed if this support isn't enabled. I see that they do have code for it
here. But it won't ship until after v1.
<div class="comment-meta commentmetadata"> April 6, 2012 at 1:50 am</div>
<div class="comment-body">
Hi David, Great post. I’m one of the developers on Web API and I thought you might like to know that we have some prototype code to support inline counts here:
http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/88372a0b4ab9#src%2fMicrosoft.Web.Http.Data%2fQueryFilterAttribute.cs. It’s implemented as a combination of an action filter that performs the count and a special ApiController base type that
is responsible for building a result object that includes the count and the results. The feature is not currently scheduled to ship for V1 as part of the core Web API but I hope the code provides some inspiration.
Pash Cracken
Member
2 Points
1 Post
Re: OData Support
May 25, 2012 10:45 AM|LINK
We really need support for $inlinecount and/or $count. With no efficent way of extending web api to support this I struggle to find a way to add proper paging. I've tried all kinds of more or less nasty hacks to add this. Please add support for this or enable a proper way for us to implement this.
Blake05
Contributor
2561 Points
511 Posts
Re: OData Support
Jul 06, 2012 05:44 PM|LINK
I second this, paging features should just be removed if this support isn't enabled. I see that they do have code for it here. But it won't ship until after v1.
Blog - Website: windowscoding.com
GaryGraves
Member
2 Points
1 Post
Re: OData Support
Aug 06, 2012 09:42 PM|LINK
You can get $count to work by using Accept:*/*. It won't return XML or JSON, but text/plain. Use WFetch to test.
Brauliod
Member
2 Points
4 Posts
Re: OData Support
Sep 05, 2012 08:03 AM|LINK
Custom extensions ($count) pain in the neck but should work:
http://www.strathweb.com/2012/06/extending-your-asp-net-web-api-responses-with-useful-metadata/
http://thedevstop.wordpress.com/2012/04/05/adding-odata-inline-count-support-to-the-asp-net-web-api/
Check the comments from a Ms employee
marcindobosz says:
<div class="comment-meta commentmetadata"> April 6, 2012 at 1:50 am</div> <div class="comment-body">Hi David, Great post. I’m one of the developers on Web API and I thought you might like to know that we have some prototype code to support inline counts here: http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/88372a0b4ab9#src%2fMicrosoft.Web.Http.Data%2fQueryFilterAttribute.cs. It’s implemented as a combination of an action filter that performs the count and a special ApiController base type that is responsible for building a result object that includes the count and the results. The feature is not currently scheduled to ship for V1 as part of the core Web API but I hope the code provides some inspiration.
</div>Book: Mastering LOB Development for Silverlight 5: A Case Study in Action