What I Do
I help you create production-ready ASP.NET Core Web API projects with:
- Clean architecture structure
- Proper dependency injection
- Swagger/OpenAPI documentation
- Global exception handling
- Request/response logging
- API versioning
- Health checks
- CORS configuration
When to Use Me
Use this skill when:
- Creating a new Web API project
- Setting up API infrastructure
- Adding middleware and filters
- Configuring API best practices
What I Create
Project Structure:
src/{ProjectName}.Api/
โโโ Controllers/
โโโ Filters/
โ โโโ GlobalExceptionFilter.cs
โ โโโ ValidationFilter.cs
โ โโโ ApiKeyFilter.cs
โโโ Middleware/
โ โโโ RequestLoggingMiddleware.cs
โ โโโ ErrorHandlingMiddleware.cs
โโโ Extensions/
โ โโโ ServiceCollectionExtensions.cs
โ โโโ ApplicationBuilderExtensions.cs
โโโ Models/
โ โโโ ErrorResponse.cs
โโโ Program.cs
โโโ appsettings.json
Key Features:
Program.cs configured with:
- Controllers and minimal APIs
- Swagger/OpenAPI
- Health checks
- CORS
- Global exception handling
- Request validation
- API versioning
GlobalExceptionFilter.cs handles exceptions
ValidationFilter.cs validates requests
RequestLoggingMiddleware.cs logs requests/responses
Best Practices I Follow
- Use minimal APIs for simple endpoints
- Implement proper HTTP status codes
- Validate all inputs
- Use DTOs for API models
- Implement proper error responses
- Add XML comments for Swagger
- Configure health checks
- Use API versioning from start
Example Usage
Create a new ASP.NET Core Web API project with:
- Swagger/OpenAPI documentation
- Health checks endpoint
- Global exception handling
- Request validation
- API versioning
- CORS configuration
I will generate all necessary files following .NET 8 best practices.