By Sir Code-A-Lot


2012-03-01 10:10:49 8 Comments

I'm playing around with the WebAPI beta, and it seems that selects have no effect on the response of an action returning an IQueryable. Eg:

http://localhost:62689/api/product?$select=Id,Name

Expected:

<Product>
<Id>1</Id>
<Name>Product 1</Name>
</Product>

Actual result:

<Product>
<Id>1</Id>
<Name>Product 1</Name>
<ItemsInStock>6</ItemsInStock>
<Price>49.99</Price>
<Created>2012-01-15T00:00:00</Created>
</Product>

Are there limitations on OData support for WebAPI?

I've tried other queries on this set of data (like top, filter) and they work fine.

1 comments

@Szilard Muzsi 2012-03-02 08:15:44

The Web API does not support the OData $select query.

The current support of query string parameters is limited to $top, $skip, $filter and $orderby.

Take a look at this forum post for more details.

@Josh C 2013-07-12 21:48:26

As of version 5.0 $select and $expand are now supported. aspnetwebstack.codeplex.com/…

Related Questions

Sponsored Content

2 Answered Questions

1 Answered Questions

OData WebAPI SubQuery

4 Answered Questions

[SOLVED] Items count in OData v4 WebAPI response

0 Answered Questions

Asp.Net Web Api trailing / causing odata query to fail

1 Answered Questions

[SOLVED] C# WebApi Odata - EF Not Filtering

1 Answered Questions

[SOLVED] Where does WebAPI 2.2 OData v4 [EnableQuery] apply?

1 Answered Questions

[SOLVED] WebApi OData: $filter 'any' or 'all' query not working

1 Answered Questions

[SOLVED] OData v4: how to make $select work on bound functions

  • 2015-03-24 22:06:25
  • Maximilian Wilson
  • 494 View
  • 3 Score
  • 1 Answer
  • Tags:   .net odata

1 Answered Questions

[SOLVED] Returning PageResult from WebAPI not formatting as OData

3 Answered Questions

Sponsored Content