The Cookbook
Auth
- Asymmetric JWT token usage
- Standard JWT Auth with Swagger support
- API Key Auth with Swagger support
- Session based Auth with Swagger support
- Basic Auth with Swagger support
- Dynamic claim/permission hydration (using IClaimsTransformation) instead of embedding in JWT
- Custom Authorization Handler (IAuthorizationHandler) Example
Configuration
Middleware & Pipeline
- IEndpointFilter usage
- Correct middleware order for Blazor Server-Side
- Correct middleware order for UseSpa() from Microsoft.AspNetCore.SpaServices.Extensions
- Legacy host-builder style with Startup.cs file
Persistence
Results Pattern
Serialization
- Receiving and sending of XML via custom binder and send method
- JsonPatch usage with Swagger UI support
- Streaming JSON response with IAsyncEnumerable
Swagger
- Customizing Swagger Spec With An IOperationProcessor
- Customizing Swagger Middleware & SwaggerUi Paths
Testing
- Integration testing with TestContainers & AppFixture
- Unit testing an endpoint that executes a command
Validation
- Adding & Throwing validation errors from deeper domain layers
- Request DTO inheritance and composition of Validators
- Validator inheritance for polymorphic DTOs.