A comprehensive .NET 9 Web API project demonstrating various concepts and patterns commonly asked in interviews.
- Custom Exception Handler - Global exception handling
- Rate Limiting - Redis-based request throttling
- Performance Monitoring - Request timing middleware
- Request Logging - HTTP request/response logging
- Maintenance Mode - Application maintenance middleware
- Patient API - CRUD operations with Entity Framework
- Security Controller - JWT authentication examples
- GuidService - Demonstrates primary constructors (C# 12)
- UserService - User management operations
- Entity Framework Core - SQL Server integration
- DbContext - Patient data management
- Algorithm implementations
- LINQ examples
- Exception handling patterns
- Parallel processing examples
# Clone and run
dotnet restore
dotnet run
# Watch mode (full restart)
dotnet watch --no-hot-reload# Core packages
dotnet add package Swashbuckle.AspNetCore
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
dotnet add package StackExchange.Redis
dotnet add package Microsoft.AspNetCore.Mvc.Versioning.ApiExplorerGET /api/patient- Get all patientsPOST /api/patient- Create patientGET /swagger- API documentation
// Traditional approach
public class GuidService
{
public Guid Id { get; set; }
public GuidService() => Id = Guid.NewGuid();
}
// Primary constructor (C# 12)
public class GuidService(Guid id = default)
{
public Guid Id { get; set; } = id == default ? Guid.NewGuid() : id;
}