Skip to content

Conversation

@gewarren
Copy link
Contributor

@gewarren gewarren commented Dec 23, 2025

Explain the benefits and trade-offs of using primary constructors in C#.


Internal previews

📄 File 🔗 Preview link
docs/fundamentals/code-analysis/style-rules/ide0290.md Use primary constructor (IDE0290)

Explain the benefits and trade-offs of using primary constructors in C#.
@gewarren gewarren requested a review from BillWagner December 23, 2025 18:42
@gewarren gewarren requested a review from a team as a code owner December 23, 2025 18:42
Copilot AI review requested due to automatic review settings December 23, 2025 18:42
@gewarren gewarren added the user-feedback Issues related to "Unified User Feedback". label Dec 23, 2025
@dotnetrepoman dotnetrepoman bot added this to the December 2025 milestone Dec 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an explanatory paragraph about the benefits and trade-offs of using primary constructors in C# to the IDE0290 style rule documentation. The addition aims to help developers understand when and why to use primary constructors versus traditional constructor syntax.

Key Changes

  • Adds a new paragraph explaining the purpose and trade-offs of primary constructors
  • Provides context about constructor generality versus declaration syntax complexity

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 @gewarren

You can :shipit: once you decide on the Copilot suggestions.

Copy link
Contributor

Copilot AI commented Jan 5, 2026

@gewarren I've opened a new pull request, #50892, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Rewrite primary constructor rationale in active voice

Converted passive voice paragraph to active voice with conversational tone per style guidelines. Uses "you" form and simpler, more direct language.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@gewarren gewarren merged commit 982e5c5 into main Jan 5, 2026
11 checks passed
@gewarren gewarren deleted the gewarren-patch-5 branch January 5, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet-fundamentals/svc user-feedback Issues related to "Unified User Feedback".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants