What are the naming conventions in C#? [closed]

The two main Capitalizations are called camelCase and PascalCase.

The basic rules (with lots of variations) are

  • Types use PascalCase
  • properties and methods always use PascalCase
  • public members (fields, consts) use PascalCase
  • local variables use camelCase
  • parameters use camelCase

And although the documentation states that “Internal and private fields are not covered by guidelines” there are some clear conventions:

  • private fields use camelCase
  • private fields that back a property prefix a _

Leave a Comment