1

Is it possible to disable the OData support?

I dont want this automatism because the filtering should be done at database level and I want do it on my own.

0

2 Answers 2

7

in ASP.NET Web API RC and onwards, you need to decorate your action with [Queryable] attribute to provide OData support. If you don't do that, then it simply won't be enabled.

UPDATE: According to this commit - http://aspnetwebstack.codeplex.com/SourceControl/changeset/changes/af11adf6b3c5 from June 7, QueryableAttribute is removed altogether in the latest build of Web API

The info says: we plan to provide much better OData support as a separate feature based on the OData library.

More info here: http://aspnetwebstack.codeplex.com/discussions/359229

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.

Sign up to request clarification or add additional context in comments.

Comments

0

So just don't return IQuerable from your actions.

2 Comments

But what shall I do if I have a collection of IQuerables?
Call ToList() or ToArray() on it, and return that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.