Skip to content

Conversation

@jkoritzinsky
Copy link
Member

Based on offline discussions, add an entry about primary constructors.

@jkoritzinsky jkoritzinsky requested review from Copilot and stephentoub and removed request for Copilot June 16, 2025 23:09
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 16, 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

Adds a new coding guideline entry for naming and using primary constructor parameters.

  • Introduces guideline #20 on camelCase naming for primary constructor parameters and when to assign them to fields.
  • Provides examples demonstrating correct parameter names and field assignments.
Comments suppressed due to low confidence (1)

docs/coding-guidelines/coding-style.md:36

  • The example assigns _items = item, but the parameter is named items, so item is undefined. It should read _items = items;.
private readonly IEnumerable<T> _items = item;

@stephentoub
Copy link
Member

/ba-g markdown-only change

@stephentoub stephentoub merged commit 59eee19 into dotnet:main Jun 17, 2025
15 of 16 checks passed
@jkoritzinsky jkoritzinsky deleted the primary-constructor-docs branch June 17, 2025 17:41
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants