Skip to content

Are there any naming rules for primary constructors? #42295

@DmitryLukyanov

Description

@DmitryLukyanov

Type of issue

Missing information

Description

I wonder whether any naming rules are considered for primary constructors? public class Entity(Dependency dependency) vs public class Entity(Dependency _dependency) ? (refer to Private instance fields start with an underscore (_) and the remaining text is camelCased.)

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/fundamentals/coding-style/identifier-names.md

Document Version Independent Id

7f85babc-6295-21dd-f194-dede663f9966

Article author

@BillWagner

Metadata

  • ID: a2d591be-290e-62d1-e99a-a7d26af20ef8
  • Service: dotnet-csharp
  • Sub-service: fundamentals

Associated WorkItem - 482339

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-csharp/svcfundamentals/subsvcokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions