After updating my project to .NET6 and OData to 8.0.4, a new Metadata controller with these endpoints appeared:
I want to disable it somehow or remove it from my service.
Code for adding OData service:
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services
.AddControllers(mvcOptions => mvcOptions.EnableEndpointRouting = false)
.AddOData(opt => opt.AddRouteComponents("", GetEdmModel()).Select().Expand());
}
Versions:
- .NET6
- ASP.NET Core 6
- OData 8.0.4
CodePudding user response:
There are several options to solve this: