Dotnet Idioms
Learn idiomatic .NET 8+ development through minimal APIs, dependency injection, and async-first patterns. Covers Entity Framework Core configuration, middleware design, and testing with xUnit. Build clean, performant, cloud-native applications aligned with modern .NET best practices.
Dotnet Idioms teaches .NET 8+ patterns for minimal APIs, dependency injection, and async-first design.
AI-generated summary based on this skill's SKILL.md
Install
irahardianto/awesome-agv/dotnet-idioms · repository language: JavaScript
git clone https://github.com/irahardianto/awesome-agv
cp -r awesome-agv/.agents/skills/dotnet-idioms ~/.claude/skills/dotnet-idiomsnpx skillfed install irahardianto/awesome-agv/dotnet-idiomsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
.NET 8 minimal APIs best practices and patterns guide?
Dotnet Idioms teaches idiomatic .NET 8+ minimal API patterns that leverage dependency injection and async-first design. The skill covers how to structure endpoints cleanly, use route groups, apply validation middleware, and integrate with Entity Framework Core. Minimal APIs reduce boilerplate compared to controllers while maintaining testability through WebApplicationFactory integration tests and proper DI configuration.
How do you use IOptions configuration in .NET applications?
Dotnet Idioms covers configuration management through IOptions, IOptionsSnapshot, and IOptionsMonitor patterns. Learn to bind strongly-typed settings from appsettings.json, use user secrets for development, and inject configuration into services via dependency injection. The skill explains scoped lifetime semantics and when to choose each options pattern for cloud-native .NET 8+ applications.
What are entity framework core scoped lifetime best practices?
Dotnet Idioms explains Entity Framework Core scoped lifetime management, including DbContext registration patterns and when to use AsNoTracking for read-only queries. The skill covers compiled queries for performance, proper migration workflows with dotnet ef migrations add, and avoiding N+1 queries. Learn how scoped services integrate with minimal API request handling.
How does Dotnet Idioms cover WebApplicationFactory integration testing?
Dotnet Idioms teaches WebApplicationFactory for writing integration tests with xUnit and FluentAssertions. Learn to configure test hosts, override DI registrations, use Respawn for database cleanup between tests, and test middleware behavior. The skill demonstrates testing minimal APIs end-to-end while maintaining isolation and repeatability in your test suite.
What custom middleware and cross-cutting concerns does Dotnet Idioms address?
Dotnet Idioms covers designing custom middleware for global error handling, logging, authentication, and request/response transformation. Learn middleware ordering, async patterns, and how to compose middleware pipelines in minimal API applications. The skill includes static analysis tools like Roslyn analyzers and dotnet format for enforcing code style across your team.
Does Dotnet Idioms cover .NET cloud-native and async-first design?
Yes, Dotnet Idioms emphasizes .NET 8+ cloud-native patterns including async-first design, proper async/await usage, and scalable architecture. The skill teaches dependency injection best practices, configuration management for containerized deployments, and how minimal APIs align with microservices patterns. Build performant, maintainable applications ready for cloud environments.
SKILL.md
rendered from the published skill — quoted content, verbatim
.NET Idioms and Patterns
.NET 8+ rewards minimal APIs, DI, and async-first design. Idiomatic .NET = clean, performant, cloud-native.
> Scope: .NET framework patterns. For C#: @.agents/skills/csharp-idioms/SKILL.md.
Minimal APIs
- Minimal APIs for simple endpoints: ```csharp app.MapGet("/api/tasks/{id}", async (string id, ITaskService service) => await service.GetByIdAsync(id) is Task task ? Results.Ok(task) : Results.NotFound());
app.MapPost("/api/tasks", async (CreateTaskRequest request, ITaskService service) => { var task = await service.CreateAsync(request); return Results.Created($"/api/tasks/{task.Id}", task); }); ```
- Controllers for complex endpoints with filters, model binding, etc.
Entity Framework Core
- DbContext per request (scoped lifetime).
- Migrations via CLI:
bash dotnet ef migrations add AddTaskPriority dotnet ef database update AsNoTracking()for read-only queries.- Compiled queries for hot paths.
Configuration
IOptions<T>pattern for
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
.agents/skills/dotnet-idioms/SKILL.md