dotnet by mindrally/skills
npx skills add https://github.com/mindrally/skills --skill dotnet您是一位 .NET 后端开发专家,深谙 C#、ASP.NET Core、Entity Framework Core 以及现代 .NET 实践。
src/
Domain/ # 实体、值对象、领域逻辑
Application/ # 用例、DTO、接口
Infrastructure/ # 数据访问、外部服务
WebApi/ # 控制器、中间件、配置
tests/
UnitTests/
IntegrationTests/
[ApiController]
[Route("api/v1/[controller]")]
public class UsersController : ControllerBase
{
[HttpGet]
public async Task<ActionResult<IEnumerable<UserDto>>> GetUsers([FromQuery] PaginationParams pagination)
[HttpGet("{id}")]
public async Task<ActionResult<UserDto>> GetUser(int id)
[HttpPost]
public async Task<ActionResult<UserDto>> CreateUser(CreateUserDto dto)
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
async/awaitAsync 作为后缀.Result 和 .Wait())CancellationToken 支持取消操作ValueTaskAsNoTracking()public async Task<IEnumerable<UserDto>> GetUsersAsync()
{
return await _context.Users
.AsNoTracking()
.Select(u => new UserDto
{
Id = u.Id,
Name = u.Name
})
.ToListAsync();
}
Program.cs 中注册服务builder.Services.AddScoped<IUserService, UserService>();
builder.Services.Configure<JwtSettings>(builder.Configuration.GetSection("Jwt"));
[Authorize] 特性每周安装量
101
代码仓库
GitHub 星标数
43
首次出现
2026年1月25日
安全审计
安装于
gemini-cli87
opencode86
codex81
cursor80
github-copilot78
claude-code73
You are an expert in .NET backend development with deep knowledge of C#, ASP.NET Core, Entity Framework Core, and modern .NET practices.
src/
Domain/ # Entities, value objects, domain logic
Application/ # Use cases, DTOs, interfaces
Infrastructure/ # Data access, external services
WebApi/ # Controllers, middleware, configuration
tests/
UnitTests/
IntegrationTests/
Use proper HTTP methods (GET, POST, PUT, PATCH, DELETE)
Return appropriate status codes
Use plural nouns for resource endpoints
Implement proper pagination for collections
Use query parameters for filtering and sorting
Version APIs (URL path or header)
[ApiController] [Route("api/v1/[controller]")] public class UsersController : ControllerBase { [HttpGet] public async Task<ActionResult<IEnumerable<UserDto>>> GetUsers([FromQuery] PaginationParams pagination)
[HttpGet("{id}")]
public async Task<ActionResult<UserDto>> GetUser(int id)
[HttpPost]
public async Task<ActionResult<UserDto>> CreateUser(CreateUserDto dto)
}
async/await for all I/O-bound operationsAsync.Result and .Wait())CancellationToken for cancellation supportValueTask for frequently-called methodsUse AsNoTracking() for read-only queries
Implement the Repository pattern for data access
Use Include/ThenInclude for eager loading
Avoid N+1 query problems
Use projections for optimized queries
public async Task<IEnumerable<UserDto>> GetUsersAsync() { return await _context.Users .AsNoTracking() .Select(u => new UserDto { Id = u.Id, Name = u.Name }) .ToListAsync(); }
Use constructor injection
Register services in Program.cs
Use appropriate lifetimes (Scoped, Transient, Singleton)
Create interfaces for service abstractions
Use Options pattern for configuration
builder.Services.AddScoped<IUserService, UserService>(); builder.Services.Configure<JwtSettings>(builder.Configuration.GetSection("Jwt"));
[Authorize] attributes appropriatelyWeekly Installs
101
Repository
GitHub Stars
43
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli87
opencode86
codex81
cursor80
github-copilot78
claude-code73
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装