Reputation: 595
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.
Upvotes: 6
Views: 2888
Reputation: 1901
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.
Upvotes: 5