[Breaking change]: EndpointName metadata no longer automatically set for minimal endpoints #473
Open
1 of 2 tasks
Labels
6.0.0
Breaking change
Documented
The breaking change has been published to the .NET Core docs
source incompatible
Source code may encounter a breaking change in behavior when targeting the new version.
Description
Starting in .NET 6 RC2, behavior that was introduced in .NET 6 RC1 to automatically set the
IEndpointNameMetadata
for endpoints has been reverted to avoid issues the logic generating duplicate endpoint names.Version
.NET 6 RC 2
Previous behavior
In .NET 6 RC1 and above, the
IEndpointNameMetadata
was automatically set for endpoints that referenced a method group. For example, the following code:Would produce an endpoint for
/foo
with aEndpointName
set to "GetFoo".New behavior
In .NET 6 RC 2 and onward, the
IEndpointNameMetadata
is no longer set. For example, the following code:would not generated any
IEndpointNameMetadat
.Type of breaking change
Reason for change
The behavior of automatically setting endpoint name metadata was not robust and resulted in issues where the same name was set for different endpoints. See dotnet/aspnetcore#36487 for more info.
Recommended action
We recommend that developers manually set the
IEndpointNameMetadata
using theWithName
extension method as follows to set the metadata.Feature area
ASP.NET Core
Affected APIs
No response
The text was updated successfully, but these errors were encountered: