I've got two methods in a controller. One accepting a parameter, the other one not.
[Produces("application/json")]
[Route("api/[controller]")]
public class ClientController : Controller
{
[HttpGet("[action]/{id}")]
public ObjectResult GetChildNodeObjects(string id)
{
//does stuff
}
[HttpGet("[action]")]
public ObjectResult GetChildNodeObjects()
{
//does other stuff
}
}
Now the problem is the first one, the one accepting a parameter.
When I hit it with http://localhost:xxxx/api/project/GetChildNodeObjects/231a
it will pick up the parameter just fine. But since I get the URL like this: http://localhost:xxxx/api/project/GetChildNodeObjects/?id=231a
it goes directly into the other controller method - the one without a parameter. What am I doing wrong for the parameter not to be caught in the second case?