Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dotnet Web Api?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-dotnet-web-api-anvil)
---
name: dotnet-web-api
description: Design ASP.NET Core Web APIs with typed endpoints, ProblemDetails responses, validation, and integration tests
---
<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->
# .NET Web API
Use when building minimal APIs or controllers in ASP.NET Core.
## Endpoints and contracts
- Return typed `Results<Ok<T>, NotFound, ValidationProblem>` unions from minimal APIs for accurate compile-time checks and OpenAPI specs.
- Configure `AddProblemDetails()` globally so unhandled exceptions and model validation emit RFC 9457 JSON payloads.
- Keep endpoint handlers thin; pass `CancellationToken` from HTTP requests through every async service and DB call.
## Middleware and hosting
- Keep middleware order explicit: exception handler -> forwarded headers (when behind a proxy) -> CORS -> authentication -> authorization -> endpoints.
- Bind settings with `IOptions<T>` and `ValidateDataAnnotations().ValidateOnStart()` so misconfiguration fails fast at boot.
- Avoid `Task.Result` or `.Wait()` inside request threads to prevent thread-pool starvation under concurrency.
## Verify
Run `dotnet test` with `WebApplicationFactory<Program>` covering serialization, status codes, and auth policies.