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.

alex
  • 614
  • 1
  • 6
  • 15

1 Answers1

1

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

alex
  • 614
  • 1
  • 6
  • 15
  • 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 – julianox Oct 15 '13 at 09:48