Skip to content

Working with $filter in a dynamic odata model #1311

Answered by Remo
Remo asked this question in Q&A
Discussion options

You must be logged in to vote

I tried to add ODataQueryOptions as an argument in my get method, but when I do that, I only get an 404 error back.
After some tinkering, I found out, that I can build the query options object myself.

IEdmModel model = Request.GetModel();
ODataQueryContext queryContext = new ODataQueryContext(model, edmEntityType, path);
ODataQueryOptions queryOptions = new ODataQueryOptions(queryContext, Request);

This seems to give me access to the filter and other things like orderby.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@gathogojr
Comment options

@Remo
Comment options

@lorenzocas
Comment options

@Remo
Comment options

Answer selected by gathogojr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants