Document GeneratedRegexAttribute property support in .NET 9#51735
Open
Document GeneratedRegexAttribute property support in .NET 9#51735
Conversation
…ort in .NET 9 Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update documentation for GeneratedRegexAttribute usage
Document GeneratedRegexAttribute property support in .NET 9
Feb 13, 2026
gewarren
approved these changes
Feb 13, 2026
docs/standard/base-types/regular-expression-source-generators.md
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the regular expression source generators documentation to reflect that GeneratedRegexAttribute can be applied to partial properties (in addition to partial methods) starting in .NET 9. This feature was introduced in .NET 9 preview 6 and leverages C# 13's partial property support.
Changes:
- Updated the introduction to note that the attribute can be applied to partial properties starting in .NET 9
- Added a new code example demonstrating the partial property syntax as an alternative to the partial method approach
- Updated Visual Studio navigation tip to reference both "method or property declaration"
docs/standard/base-types/regular-expression-source-generators.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gewarren
reviewed
Feb 14, 2026
docs/standard/base-types/regular-expression-source-generators.md
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documentation for
GeneratedRegexAttributeonly mentioned partial methods, but starting in .NET 9 (preview 6), the attribute can also be applied to partial properties via C# 13's partial property support.Changes
The property and method approaches are functionally equivalent; properties provide an alternative syntax.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Internal previews