I have a controller with several public methods in ASP.NET core 8
<HttpPost("{methName?}">
Public Async Function HttpPost(methName As String) As Task(Of IActionResult)
then several other public methods like this that I don’t want as endpoints without routing attributes
Public Sub Foo()
When I execute URL: “domain/controllerName/method”
All works OK. The HttpPost method gets executed as expected.
When I execute URL: “domain/controllerName”
I get an ambiguity error stating that HttpPost and all my other public functions without http attributes are now not only candidates for routing but they all match and can’t resolve
I get that public members are automatically candidates for endpoint actions but none of them actually match. Foo and all my other method names don’t match with anything. The only thing that matches is again the HttpPost method that has a configured route to take no argument.
And yes I know you can mark methods with [NonAction] and use Order = -1 to solve the ambiguity but I need to know why this absurd behavior.