software-csharp-backend
Installation
SKILL.md
C# Backend Engineering
Quick Reference
| Decision | Default | Notes |
|---|---|---|
| Runtime | Current .NET LTS and its C# version | Look up the current LTS and its end date on the dotnet support policy page before naming a version. Treat any target within a year of end of support as a tracked migration, not a steady state. Choose the current LTS by default; choose a newer STS only if the team upgrades every year |
| API style | Minimal API for new endpoints | Controllers for large CQRS surface with many filters/action results |
| Persistence (SQL, write-heavy) | EF Core | Use Dapper when query shapes are complex and hand-tuned SQL wins |
| Persistence (SQL, query-heavy) | Dapper | Pair with EF Core for write path if aggregates exist |
| Persistence (document) | MongoDB driver | Use when schema variability is genuine, not habitual |
| Background worker | IHostedService / BackgroundService |
Add lease, graceful shutdown, and poison-message handling from day one |
| Resilience | Microsoft.Extensions.Resilience (Polly v8) |
AddStandardResilienceHandler() runs five strategies, outermost first: rate limiter → total timeout → retry → circuit breaker → attempt timeout. It retries all HTTP methods by default. Override the defaults for unsafe methods and for tight deadlines. Retry at one layer only: a handler added to a client that ConfigureHttpClientDefaults (for example, service defaults) already wraps, or an app-level retry around a retrying client or EF execution strategy, multiplies attempts. See references/resilience-policy-defaults.md |
| OpenAPI | Built-in ASP.NET Core OpenAPI (Microsoft.AspNetCore.OpenApi) |
Do not add Swashbuckle unless repo already uses it |
Route other tasks:
- NUnit fixture design, WireMock/Testcontainers setup, or flake reduction →
$qa-testing-nunit nuke/Build.cs, CI target sequencing, or artifact publication →$ops-nuke-cicd- Legacy
ILoggeror Serilog rewrite automation →$dev-structured-logs