Unbound actions and functions are not called when custom routing is switched on
- A unbound function is implemented with an "ODataRoute" Attribute, for example "[ODataRoute("MigrateFirebaseToMssql")]"
- In the startup.cs file, default routing conventions are created ("ODataRoutingConventions.CreateDefault()")
- an odata service route is created with these default conventions ("oRouteBilder.MapODataServiceRoute("odata", "", GetEdmModel(), new DefaultODataPathHandler(), oConventions, new DefaultODataBatchHandler());") -after these lines, the unbound function with attribute routing not callable anymore
Actual result
404 Error Result
Reproduce steps
Startup.cs
oApp.UseMvc(oRouteBilder =>
{
// Create the default collection of built-in conventions.
var oConventions = ODataRoutingConventions.CreateDefault();
oRouteBilder.SetTimeZoneInfo(TimeZoneInfo.Local);
oRouteBilder.Select().Filter().Count().MaxTop(null).Expand().OrderBy();
oRouteBilder.MapODataServiceRoute("odata", "", GetEdmModel(), new DefaultODataPathHandler(), oConventions, new DefaultODataBatchHandler());
oRouteBilder.EnableDependencyInjection();
});
UnboundFunctionController.cs
[HttpGet]
[ODataRoute("MigrateFirebaseToMssql")]
public async Task<IActionResult> MigrateFirebaseToMssqlAsync()
{
return Ok(true);
}
@xpr0gamers What code is in your "GetEdmModel"?
@xpr0gamers How you doing.
CreateDefault defined here doesn't include attribute routing.
if you want to use the attribute routing, you can call the method defined here
Thank you for your answer. With wich parameters, must i call the function?
I get now an error.

@xpr0gamers here's an example: https://github.com/OData/WebApi/blob/master/samples/AspNetCore3xEndpointSample.Web/Startup.cs#L64
@xpr0gamers Were you able to resolve this issue?
Closing this issue due to inactivity. If this issue still persists, feel free to create a new issue.