Skip to content

Are there any naming rules for primary constructors? #42295

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions