- Use dependency injection via `IServiceCollection` — register services in `Program.cs` with `AddScoped`, `AddTransient`, or `AddSingleton`.
- Use the Options pattern (`IOptions<T>`) for strongly-typed configuration instead of reading `IConfiguration` directly.
- Apply middleware in the correct order: exception handling → HTTPS redirect → static files → routing → auth → endpoints.
- Use `async`/`await` throughout the request pipeline — never block with `.Result` or `.Wait()` on async methods.
- Use `IOptions<T>` for typed configuration binding from `appsettings.json`.
- Use middleware pipeline for cross-cutting concerns (auth, logging, error handling, CORS).
- Use Entity Framework Core with code-first migrations for database operations.
- Use `ILogger<T>` for structured logging — never use `Console.WriteLine` in production.