Routes can't be differentiated by query params

Hi there,

if I have more than 1 method with 'same routing' but different 'query' (example below) I get an 'AmbiguousActionError'



    [HttpGet]
    [Route('myquery')]
    function QueryByName([FromQuery] const Name: string): TResult;
    [HttpGet]
    [Route('myquery')]
    function QueryById([FromQuery] const Id: string): TResult;


With that, the effect I was looking for is:

GET /.../myquery?name='some data'
and
GET /.../myquery?id='some data'


Is this behavior/error by design ? or the code above should work?

Att

It's by design. Parameter names are not considered in the definition of an action.

One thing you can do is declare a single method receiving both parameters, both being optional.
Hi Wagner,

Thanks for the clarification and very nice sugestion. 

For now, I've created a single method with no parameters at all. And I check the Request.Uri.Query for any params present

Regards,