dotnet-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-api
dotnet-api
Overview
概述
ASP.NET Core APIs, data access, backend services, security, and cloud-native patterns. This consolidated skill spans 32 topic areas. Load the appropriate companion file from based on the routing table below.
references/Baseline dependency: defines the core ASP.NET Core Minimal API patterns (route groups, endpoint filters, TypedResults, parameter binding) that apply to most API development tasks. Load it by default when building HTTP endpoints.
references/minimal-apis.mdMost-shared companion: covers vertical slices, request pipelines, error handling, caching, and idempotency patterns used across nearly all ASP.NET Core projects.
references/architecture-patterns.mdASP.NET Core API、数据访问、后端服务、安全及云原生模式。该整合技能覆盖32个主题领域。请根据下方的路由表从目录加载对应的配套文件。
references/基线依赖:定义了核心的ASP.NET Core Minimal API模式(路由组、端点过滤器、TypedResults、参数绑定),适用于大多数API开发任务。构建HTTP端点时默认加载该文件。
references/minimal-apis.md最常用的配套文件:涵盖了垂直切片、请求管道、错误处理、缓存和幂等性模式,几乎所有ASP.NET Core项目都会用到这些内容。
references/architecture-patterns.mdRouting Table
路由表
| Topic | Keywords | Description | Companion File |
|---|---|---|---|
| Minimal APIs | endpoint, route group, filter, TypedResults | Minimal API route groups, filters, TypedResults, OpenAPI | references/minimal-apis.md |
| Middleware | pipeline ordering, short-circuit, exception | Pipeline ordering, short-circuit, exception handling | references/middleware-patterns.md |
| EF Core patterns | DbContext, migrations, AsNoTracking | DbContext, AsNoTracking, query splitting, migrations | references/efcore-patterns.md |
| EF Core architecture | read/write split, aggregate boundaries, N+1 | Read/write split, aggregate boundaries, N+1 | references/efcore-architecture.md |
| Data access strategy | EF Core vs Dapper vs ADO.NET decision | EF Core vs Dapper vs ADO.NET decision matrix | references/data-access-strategy.md |
| gRPC | proto, code-gen, streaming, auth | Proto definition, code-gen, ASP.NET Core host, streaming | references/grpc.md |
| Real-time | SignalR, SSE, JSON-RPC, gRPC streaming | SignalR hubs, SSE, JSON-RPC 2.0, scaling | references/realtime-communication.md |
| Resilience | Polly v8, retry, circuit breaker, timeout | Polly v8 retry, circuit breaker, timeout, rate limiter | references/resilience.md |
| HTTP client | IHttpClientFactory, typed/named, DelegatingHandler | IHttpClientFactory, typed/named clients, DelegatingHandlers | references/http-client.md |
| API versioning | Asp.Versioning, URL/header/query, sunset | Asp.Versioning.Http/Mvc, URL/header/query, sunset | references/api-versioning.md |
| OpenAPI | MS.AspNetCore.OpenApi, Swashbuckle, NSwag | MS.AspNetCore.OpenApi, Swashbuckle migration, NSwag | references/openapi.md |
| API security | Identity, OAuth/OIDC, JWT, CORS, rate limiting | Identity, OAuth/OIDC, JWT bearer, CORS, rate limiting | references/api-security.md |
| OWASP | injection, auth, XSS, deprecated APIs | OWASP Top 10 hardening for .NET | references/security-owasp.md |
| Secrets | user secrets, env vars, rotation | User secrets, environment variables, rotation | references/secrets-management.md |
| Cryptography | AES-GCM, RSA, ECDSA, hashing, key derivation | AES-GCM, RSA, ECDSA, hashing, PQC key derivation | references/cryptography.md |
| Background services | BackgroundService, IHostedService, lifecycle | BackgroundService, IHostedService, lifecycle | references/background-services.md |
| Aspire | AppHost, service discovery, dashboard | AppHost, service discovery, components, dashboard | references/aspire-patterns.md |
| Semantic Kernel | AI/LLM plugins, prompts, memory, agents | AI/LLM plugins, prompt templates, memory, agents | references/semantic-kernel.md |
| Architecture | vertical slices, layered, pipelines, caching | Vertical slices, layered, pipelines, caching | references/architecture-patterns.md |
| Messaging | Wolverine, Azure Service Bus, RabbitMQ, pub/sub, sagas | Wolverine, Azure Service Bus, RabbitMQ, pub/sub, sagas | references/messaging-patterns.md |
| Service communication | REST vs gRPC vs SignalR decision matrix | REST vs gRPC vs SignalR decision matrix | references/service-communication.md |
| API surface validation | PublicApiAnalyzers, Verify, ApiCompat | PublicApiAnalyzers, Verify snapshots, ApiCompat | references/api-surface-validation.md |
| Library API compat | binary/source compat, type forwarders | Binary/source compat, type forwarders, SemVer | references/library-api-compat.md |
| I/O pipelines | PipeReader/PipeWriter, backpressure, Kestrel | PipeReader/PipeWriter, backpressure, Kestrel | references/io-pipelines.md |
| Agent gotchas | async misuse, NuGet errors, DI mistakes | Common agent mistakes in .NET code | references/agent-gotchas.md |
| File-based apps | .NET 10, directives, csproj migration | .NET 10 file-based C# apps | references/file-based-apps.md |
| API docs | DocFX, OpenAPI-as-docs, versioned docs | DocFX, OpenAPI-as-docs, versioned documentation | references/api-docs.md |
| HybridCache | HybridCache, L1/L2, stampede, tag eviction | HybridCache (.NET 9+), stampede protection, tag-based eviction | references/hybrid-cache.md |
| YARP | reverse proxy, load balancing, API gateway, BFF | YARP reverse proxy, load balancing, health checks, transforms | references/yarp.md |
| Output caching | OutputCache, response caching, compression | Output/response caching, compression, CDN, tag invalidation | references/output-caching.md |
| Identity | ASP.NET Core Identity, login, MFA, scaffolding | Identity setup, scaffolding, external providers, MapIdentityApi | references/identity-setup.md |
| Office documents and PDF | Excel, Word, PowerPoint, PDF, Open XML SDK, spreadsheet, docx, xlsx, PDFsharp, MigraDoc, merge PDF, split PDF, watermark | Open XML SDK, ClosedXML, PDFsharp/MigraDoc for PDF create/read/merge/split/watermark | references/office-documents.md |
| 主题 | 关键词 | 描述 | 配套文件 |
|---|---|---|---|
| Minimal APIs | endpoint, route group, filter, TypedResults | Minimal API路由组、过滤器、TypedResults、OpenAPI | references/minimal-apis.md |
| Middleware | pipeline ordering, short-circuit, exception | 管道排序、短路处理、异常处理 | references/middleware-patterns.md |
| EF Core patterns | DbContext, migrations, AsNoTracking | DbContext、AsNoTracking、查询拆分、迁移 | references/efcore-patterns.md |
| EF Core architecture | read/write split, aggregate boundaries, N+1 | 读写分离、聚合边界、N+1问题 | references/efcore-architecture.md |
| Data access strategy | EF Core vs Dapper vs ADO.NET decision | EF Core、Dapper、ADO.NET选型矩阵 | references/data-access-strategy.md |
| gRPC | proto, code-gen, streaming, auth | Proto定义、代码生成、ASP.NET Core宿主、流式传输 | references/grpc.md |
| Real-time | SignalR, SSE, JSON-RPC, gRPC streaming | SignalR集线器、SSE、JSON-RPC 2.0、扩缩容 | references/realtime-communication.md |
| Resilience | Polly v8, retry, circuit breaker, timeout | Polly v8重试、断路器、超时、速率限制 | references/resilience.md |
| HTTP client | IHttpClientFactory, typed/named, DelegatingHandler | IHttpClientFactory、类型化/命名客户端、DelegatingHandler | references/http-client.md |
| API versioning | Asp.Versioning, URL/header/query, sunset | Asp.Versioning.Http/Mvc、URL/Header/Query版本控制、版本淘汰 | references/api-versioning.md |
| OpenAPI | MS.AspNetCore.OpenApi, Swashbuckle, NSwag | MS.AspNetCore.OpenApi、Swashbuckle迁移、NSwag | references/openapi.md |
| API security | Identity, OAuth/OIDC, JWT, CORS, rate limiting | Identity、OAuth/OIDC、JWT承载认证、CORS、速率限制 | references/api-security.md |
| OWASP | injection, auth, XSS, deprecated APIs | .NET项目OWASP Top 10加固方案 | references/security-owasp.md |
| Secrets | user secrets, env vars, rotation | 用户密钥、环境变量、密钥轮换 | references/secrets-management.md |
| Cryptography | AES-GCM, RSA, ECDSA, hashing, key derivation | AES-GCM、RSA、ECDSA、哈希、后量子密码学密钥派生 | references/cryptography.md |
| Background services | BackgroundService, IHostedService, lifecycle | BackgroundService、IHostedService、生命周期 | references/background-services.md |
| Aspire | AppHost, service discovery, dashboard | AppHost、服务发现、组件、仪表板 | references/aspire-patterns.md |
| Semantic Kernel | AI/LLM plugins, prompts, memory, agents | AI/LLM插件、提示词模板、记忆、Agent | references/semantic-kernel.md |
| Architecture | vertical slices, layered, pipelines, caching | 垂直切片、分层架构、管道、缓存 | references/architecture-patterns.md |
| Messaging | Wolverine, Azure Service Bus, RabbitMQ, pub/sub, sagas | Wolverine、Azure Service Bus、RabbitMQ、发布订阅、Saga | references/messaging-patterns.md |
| Service communication | REST vs gRPC vs SignalR decision matrix | REST、gRPC、SignalR选型矩阵 | references/service-communication.md |
| API surface validation | PublicApiAnalyzers, Verify, ApiCompat | PublicApiAnalyzers、Verify快照、ApiCompat | references/api-surface-validation.md |
| Library API compat | binary/source compat, type forwarders | 二进制/源码兼容性、类型转发、语义化版本 | references/library-api-compat.md |
| I/O pipelines | PipeReader/PipeWriter, backpressure, Kestrel | PipeReader/PipeWriter、背压、Kestrel | references/io-pipelines.md |
| Agent gotchas | async misuse, NuGet errors, DI mistakes | .NET代码中常见的Agent错误 | references/agent-gotchas.md |
| File-based apps | .NET 10, directives, csproj migration | .NET 10基于文件的C#应用 | references/file-based-apps.md |
| API docs | DocFX, OpenAPI-as-docs, versioned docs | DocFX、基于OpenAPI的文档、版本化文档 | references/api-docs.md |
| HybridCache | HybridCache, L1/L2, stampede, tag eviction | HybridCache(.NET 9+)、缓存击穿防护、基于标签的驱逐 | references/hybrid-cache.md |
| YARP | reverse proxy, load balancing, API gateway, BFF | YARP反向代理、负载均衡、健康检查、转换规则 | references/yarp.md |
| Output caching | OutputCache, response caching, compression | 输出/响应缓存、压缩、CDN、标签失效 | references/output-caching.md |
| Identity | ASP.NET Core Identity, login, MFA, scaffolding | Identity配置、脚手架、外部登录提供者、MapIdentityApi | references/identity-setup.md |
| Office documents and PDF | Excel, Word, PowerPoint, PDF, Open XML SDK, spreadsheet, docx, xlsx, PDFsharp, MigraDoc, merge PDF, split PDF, watermark | Open XML SDK、ClosedXML、PDFsharp/MigraDoc用于PDF的创建/读取/合并/拆分/加水印 | references/office-documents.md |
Scope
适用范围
- ASP.NET Core web APIs (minimal and controller-based)
- Data access (EF Core, Dapper, ADO.NET)
- Service communication (gRPC, SignalR, SSE, messaging)
- Security (auth, OWASP, secrets, crypto)
- Cloud-native (Aspire, resilience, background services)
- AI integration (Semantic Kernel)
- Architecture patterns and API surface validation
- ASP.NET Core Web API(Minimal和基于控制器的)
- 数据访问(EF Core、Dapper、ADO.NET)
- 服务通信(gRPC、SignalR、SSE、消息传递)
- 安全(身份验证、OWASP、密钥管理、加密)
- 云原生(Aspire、弹性机制、后台服务)
- AI集成(Semantic Kernel)
- 架构模式与API表面验证
Out of scope
不适用范围
- C# language features -> [skill:dotnet-csharp]
- UI rendering -> [skill:dotnet-ui]
- Test authoring -> [skill:dotnet-testing]
- CI/CD pipelines -> [skill:dotnet-devops]
- Build tooling -> [skill:dotnet-tooling]
- C#语言特性 -> [skill:dotnet-csharp]
- UI渲染 -> [skill:dotnet-ui]
- 测试编写 -> [skill:dotnet-testing]
- CI/CD流水线 -> [skill:dotnet-devops]
- 构建工具 -> [skill:dotnet-tooling]