Q:

Multiple GET() methods with a single parameter result in AmbiguousMatchException: The request matched multiple endpoints

[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
}

[HttpGet("{id}")]
public ActionResult<string> Get([FromRoute]int id)
{
}

[HttpGet]
public ActionResult<IEnumerable<string>> Get()([FromQuery]DateTime dateTime)
{
}

I can reach the second with:
https://localhost:44341/api/Orders/3

But for the first and third:
https://localhost:44341/api/Orders
https://localhost:44341/api/Orders?dateTime=2019-11-01T00:00:00

Both of these return the error:

AmbiguousMatchException

Core 2.2, if it matters.

A:

I ended up just creating a different endpoint for the GetByDate method.

[HttpGet]
public ActionResult<string> Get()
{
    //
}

[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
    //
}

[HttpGet("ByDate/{date}")]
public ActionResult<string> ByDate(DateTime date)
{
    //
}

They can be called as follows:
https://localhost:44341/api/controller
https://localhost:44341/api/controller/1
https://localhost:44341/api/controller/getbydate/2019-11-01

