-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[Breaking change]: FromKeyedServicesAttribute.Key may be null #46269
Copy link
Copy link
Closed
dotnet/dotnet-api-docs
#11866Labels
🏁 Release: .NET 8Work items for the .NET 8 releaseWork items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.🗺️ mapQUESTOnly used as a way to mark an issue as updated for quest. RepoMan should instantly remove it.Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it.breaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking change
Metadata
Metadata
Labels
🏁 Release: .NET 8Work items for the .NET 8 releaseWork items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.🗺️ mapQUESTOnly used as a way to mark an issue as updated for quest. RepoMan should instantly remove it.Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it.breaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking change
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
FromServiceKeyAttributehas been extended to support null (for unkeyed) and inheritance.Version
.NET 8
Previous behavior
FromServiceKeyAttribute.Keywas a non-nullable objectobject.New behavior
FromServiceKeyAttribute.Keyis a nullable objectobject?.Type of breaking change
Reason for change
See dotnet/runtime#113585. Support was added for keyed services to annotate parameters as unkeyed.
Recommended action
Adjust any caller that is using
FromServiceKeyAttributeto accept anullvalue forKey.Feature area
Extensions
Affected APIs
Microsoft.Extensions.DependencyInjection.FromServiceKeyAttribute.Key
Associated WorkItem - 486863