0

Is this possible? For example,

 [GET("api/item/{id}/related")] public dynamic GetRelatdItemsById(string id, Filter filter) { // get items related by id and optionally filter by `filter` } 

If this is possible, how should the query string be setup??

many thanks.

1 Answer 1

1

Nevermind that. Just forgotten to use the [FromUri] attribute. :)

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

1 Comment

hi alex, just stumbled on your question but i couldn't make my querystring to work without having the {id}. For example, i have a GetUsers(int id)/GetUserByUserName(string username)/GetUserByName(string name). But, if the user has username=1234 or name=1234 we might have a valid 1234 id in the and database and all the routes will be mixed up. What i'd like to do is to have filters for the last 2 methods to get querystrings for filtering api/users/?username=1234 or api/users/?name=1234 . Do you have any idea how i could get this working? cheers

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.