Best practices
Habits experienced C# teams agree on.
Enable nullable reference types
Use built-in dependency injection
Microsoft.Extensions.DependencyInjection: register services by lifetime (singleton, scoped, transient) and inject interfaces.
Async all the way
Once a call is async, keep callers async; pass CancellationToken through.
Dispose what you own
Wrap IDisposable / IAsyncDisposable in using or await using declarations.
Treat analyzer warnings as errors
Roslyn analyzers and .editorconfig keep a team's style consistent.
Saved in this browser only. Part of Clean code foundations (0/5).