- Structure projects with Clean Architecture layers: API (controllers), Application (services/DTOs), Domain (entities/interfaces), Infrastructure (data access).
- Register services using ASP.NET Core Dependency Injection in Program.cs with appropriate lifetimes (Scoped, Transient, Singleton).
- Use async/await for all I/O-bound operations in controllers, services, and data access.
- Document APIs with Swagger/OpenAPI, enhanced by XML comments on controllers, models, and methods.
- Secure endpoints with authentication (JWT/ASP.NET Identity), HTTPS enforcement, CORS policies, and model validation.
- Use `[ApiController]` attribute on controllers for automatic model validation and `[FromBody]`/`[FromQuery]` binding.
- Register services with `builder.Services.AddScoped<IService, Service>()` — use `AddSingleton` for stateless services and `AddTransient` for lightweight ones.
- Use `IOptions<T>` pattern for typed configuration: bind sections with `builder.Services.Configure<SmtpSettings>(config.GetSection("Smtp"))`.
- Return `ActionResult<T>` from controller methods for typed responses with proper HTTP status codes.