Skip to content

feat(codegen): support record parameter field ids - #10495

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-pr-9791
Aug 11, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-pr-9791

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Problem

[Id] could not be applied directly to positional record parameters, forcing users to target the generated property with the more verbose [property: Id(...)] syntax.

Solution

Allow IdAttribute on parameters and have code generation honor those explicit IDs, including when implicit public-property field IDs are enabled. Add generator, model, and serialization coverage using non-positional IDs, update the generated API surface, and document the concise record syntax.

This replaces #9791, whose org-owned bot branch could not be updated after it developed conflicts.

Closes #9780

Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ReubenBond
ReubenBond merged commit 2f6c0b5 into dotnet:main Aug 11, 2026
131 of 134 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-pr-9791 branch August 11, 2026 19:42
This was referenced Aug 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for [Id] annotations on record primary constructor parameters

1 participant