aspnetcore/breaking-changes/6/endpointname-metadata.md
Behavior that was introduced in .NET 6 RC 1 to automatically set IEndpointNameMetadata for endpoints has been reverted. IEndpointNameMetadata is no longer set automatically to avoid issues with duplicate endpoint names.
ASP.NET Core 6 RC 2
In ASP.NET Core 6 RC 1, IEndpointNameMetadata was automatically set for endpoints that referenced a method group. For example, the following code produced an endpoint for /foo with EndpointName set to GetFoo.
app.MapGet("/foo", GetFoo);
Starting in ASP.NET Core 6 RC 2, IEndpointNameMetadata is not automatically set. The following code does not generate any IEndpointNameMetadata.
app.MapGet("/foo", GetFoo);
This change can affect source compatibility.
The behavior of automatically setting endpoint name metadata was not robust and resulted in issues where the same name was set for different endpoints. For more information, see dotnet/aspnetcore#36487.
We recommend that you manually set IEndpointNameMetadata using the WithName extension method to set the metadata.
app.MapGet("/foo", GetFoo).WithName("GetFoo");
N/A