OData support?

Topics: ASP.NET Web API
Jun 11, 2012 at 11:27 PM

Changeset 'af11adf6b3c5by' last week mentions "we plan to provide much better OData support as a separate feature based on the OData library."

Could someone elaborate?


Jun 12, 2012 at 4:32 AM

+1 for elaboration

Jun 12, 2012 at 5:59 PM

Digging through the code, is there any OData filtering support or has it all been removed for RC?

Jun 12, 2012 at 8:01 PM

Also wondering what's happening here. Is OData support going to make it to RTM? You didn't listen to the trolls did you? OData URI convention support is such a wicked feature, would be a shame to delay it.

Coordinator
Jun 13, 2012 at 5:53 PM

Sure. ASP.NET Web API today only has very limited OData support. We only support four OData query operators: $top, $skip, $orderby and $filter.

We are working on much richer OData support for ASP.NET Web API including an OData formatter, an EDM model builder, richer query support, $metadata support and link generation support. The idea is to compliment the OData support in WCF Data Services by providing better support for data sources that may not provide full OData query semantics and also by enabling more flexible support for custom business logic.

We are working in close collaboration with the Microsoft OData team that builds the ODataLib NuGet package and the ASP.NET Web API OData support will be based on ODataLib. We hope to be able to check-in an initial preview of the new OData support to the CodePlex repository in the next month or two.

Hope this helps.

Jun 19, 2012 at 4:09 PM

Hi all,

I don't know if its intentional but the OData implementation ignores invalid or unsupported query options such as $iflter (typo is intended). The OData specification reads as follows:

OData services SHOULD NOT require any query options to be specified in a request, and SHOULD fail any request that contains query options that it does not understand.

I guess a moot point here is the possibility of breaking existing working code, that actually shouldn't be working, if you decide to comply with the standard. At the moment, the filter will be ignored and more results will be returned than the developer anticipates.

Thanks and keep up the good work,

Luke

Jun 27, 2012 at 2:03 AM

Luke,

I think that statement should be interpreted like this:

... SHOULD fail any request that contains [system] query options that it does not understand.

The distinction is important because clearly $iflter is not defined in OData at the moment, so is NOT a system query option.
Which means the OData implementation behavior is as intended. 

-Alex

Aug 31, 2012 at 8:35 AM

It's the last day of August. Any news/updates on the "issue"  ?

Marty

Aug 31, 2012 at 1:53 PM

Marty, Are you asking for where we are with OData support? We have released a preview of the much improved support. You can find an overview of the new feature here [1] and a detailed description here [2] and here [3]. You can get the latest nightly nuget package for trying it out, see [4].

Hope this helps,

Henrik

[1] http://blogs.msdn.com/b/henrikn/archive/2012/08/15/asp-net-web-api-released-and-a-preview-of-what-s-next.aspx

[2] http://blogs.msdn.com/b/alexj/archive/2012/08/15/odata-support-in-asp-net-web-api.aspx

[3] http://blogs.msdn.com/b/alexj/archive/2012/08/21/web-api-queryable-current-support-and-tentative-roadmap.aspx

[4] http://blogs.msdn.com/b/henrikn/archive/2012/06/01/using-nightly-asp-net-web-stack-nuget-packages-with-vs-2012-rc.aspx