Exception: Request matched multiple endpoints
Open
@xuzhg is already working on this.
Since Apr 21, 2021.
investigated
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
NugetPackage: Microsoft.AspNetCore.OData -Version 8.0.0-rc
BEFORE
Given I add a Get() method to the controller,
And I start the App
Then the expected response is returned.
Controller
public class EntitiesController: ODataController
{
private Context _context;
public EntitiesController(Context context)
{
_context = context;
}
[EnableQuery]
public IActionResult Get()
{
return Ok(_context.Entities);
}
}
Response

AFTER
Given I add a second Get(int id) method,
And I start the App,
Then an exception is thrown.
Controller
public class EntitiesController: ODataController
{
private Context _context;
public EntitiesController(Context context)
{
_context = context;
}
[EnableQuery]
public IActionResult Get()
{
return Ok(_context.Entities);
}
[EnableQuery]
public IActionResult Get(int id)
{
return Ok(_context.Entities.FirstOrDefault(entity => entity.Id == id));
}
}
Response

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.