Routing is not a Breeze problem. How your server sends requests to your controller is up to you. What we do out of the box is just one way among countless many.
Do you have the [BreezeController] attribute on your controller? Can you put the end point of the sample where we could hit it. Could get some tips from this. Also put the controller. A tiny example should ... return metadata and one method that returns IQueryable.
June 25, 2013 Patch
I think you found an error in how our [BreezeController] detects methods that return an IQueryable<T> .
The [BreezeController] attribute scans your web API control methods and (in effect) applies the [BreezeQueryable] attribute to methods that return IQueryable<T> .
[BreezeQueryable] is a [Queryable] web API extension that adds support for $ select, $ expand and nested $ orderby ... all missing in the current [Queryable] .
Now I see that your GetUsers() method returns an HttpResponseMessage , not an IQueryable<User> . Suppose the userInfoController.GetUsers() method inside your method returns an IQueryable<User> . Otherwise, the OData query parameters will not be applied, and we will have to take this in a different direction. We move forward ...
I checked with v.1.3.6 Breeze.WebApi.dll and did not find that HttpResponseMessage is an IQueryable<T> wrapper. Therefore, it does not apply OData client request criteria (or any other OData modifiers, for that matter). This flaw (in my opinion) is a mistake. The following should be equivalent implementations:
[HttpGet] public IQueryable<TodoItem> Todos() { return _repository.Todos; } [HttpGet] public HttpResponseMessage TodosWrapped() { return Request.CreateResponse(HttpStatusCode.OK, _repository.Todos); }
The second wrapped method does not consider OData query parameters.
Fortunately, there is a workaround until we fix this. Just add the [BreezeQueryable] attribute explicitly ... as in:
[HttpGet] [BreezeQueryable] public HttpResponseMessage TodosWrapped() { return Request.CreateResponse(HttpStatusCode.OK, _repository.Todos); }
I have confirmed that this approach works .
Thanks for finding this.
Use OData query syntax h3>
A colleague also noticed that your request URL does not use OData request syntax. You wrote:
... / todos? = DareId% 20eq% 204
when should he be
... / todos /? $ filter = DareId% 20eq% 204
Make sure you use ?$filter=