Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 29, 2025

Fixes two minor typos in the XML documentation remarks for the FromKeyedServicesAttribute.Key property:

  • Fixed "value with indicates" → "value indicates"
  • Fixed "explict" → "explicit"

The documentation already correctly reflects the breaking change where FromKeyedServicesAttribute.Key became nullable (object?) in .NET 8, including comprehensive remarks explaining when and why the Key can be null for unkeyed services and key inheritance scenarios.

Addresses issue #37143e44 regarding the breaking change documentation for FromKeyedServicesAttribute.Key nullability.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Breaking change]: FromKeyedServicesAttribute.Key may be null</issue_title>
<issue_description>### Description

FromServiceKeyAttribute has been extended to support null (for unkeyed) and inheritance.

Version

.NET 8

Previous behavior

FromServiceKeyAttribute.Key was a non-nullable object object.

New behavior

FromServiceKeyAttribute.Key is a nullable object object?.

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

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 FromServiceKeyAttribute to accept a null value for Key.

Feature area

Extensions

Affected APIs

Microsoft.Extensions.DependencyInjection.FromServiceKeyAttribute.Key


Associated WorkItem - 486863</issue_description>

<agent_instructions>Don't create a breaking change article for this repo. Just update the property's remarks as needed.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes dotnet/docs#46269

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [Breaking change]: FromKeyedServicesAttribute.Key may be null Fix typos in FromKeyedServicesAttribute.Key documentation remarks Sep 29, 2025
@Copilot Copilot AI requested a review from gewarren September 29, 2025 20:52
Copilot finished work on behalf of gewarren September 29, 2025 20:52
@gewarren gewarren marked this pull request as ready for review September 29, 2025 21:57
@gewarren gewarren requested a review from a team as a code owner September 29, 2025 21:57
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Lets :shipit:

@gewarren gewarren merged commit 60e1661 into main Oct 3, 2025
5 checks passed
@gewarren gewarren deleted the copilot/fix-37143e44-a675-4e9d-a1c2-995c02d9e3fd branch October 3, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Breaking change]: FromKeyedServicesAttribute.Key may be null
3 participants