DO

.NET Conventions

Used in 50 csharp projects (avg ★104)

C#
Style Guide
Default
Used by 50 projects

Details

Language / Topic
csharpC#
Category
Style Guide
Source
Microsoft

Rules

balanced
- Use PascalCase for classes, methods, properties, and public members.
- Use camelCase for local variables and private fields (prefix private fields with '_' where conventional).
- Apply async/await for all I/O-bound operations.
- Write clear, descriptive commit messages in English.
- Utilize ASP.NET Core built-in dependency injection.
- Prefer LINQ and lambda expressions for collection and data manipulation.
- Organize code in layered structure: Domain (entities/interfaces), Application (services/DTOs), Infrastructure (repositories/external), Api/Presentation.
- Use feature branches, atomic commits, and pull requests for changes.
- Employ file-scoped namespaces (`namespace X;`).
- Prefer `var` when type is apparent from context.