How to prevent HTTP 404 for a custom action in an odata controller?
问题 I have an ASP.Net WebApi2 project hosting odata both ApiController and ODataController . And I want to add a custom action in an ODataController . I saw this seems to be achievable by either adding [HttpPost] attribute on the desired action, or by configuring the ODataConventionModelBuilder with a specific FunctionConfiguration when using the MapODataServiceRoute. To distinguish between odata routes and webapi routes we use the following scheme : odata : http://localhost:9292/myProject/odata