C# Naming Conventions: Microsoft's Official Guidelines

5 min read

C# has well-documented naming conventions from Microsoft, followed across the .NET ecosystem.

Convention Table

ItemConventionExample
Classes/StructsPascalCaseUserAccount
InterfacesI + PascalCaseIDisposable
MethodsPascalCaseGetUserById()
PropertiesPascalCaseFirstName
EventsPascalCaseOnClick
Local variablescamelCaseuserName
ParameterscamelCaseuserId
ConstantsPascalCaseMaxRetryCount
Private fields_camelCase_connectionString

Note: C# uses PascalCase for constants, not SCREAMING_SNAKE — unlike most other languages.

Convert

PascalCase, camelCase. Hub.