
Dotnet Patterns
This is a comprehensive reference for writing production-quality C# code the way experienced .NET developers actually do it. It covers the patterns that matter: dependency injection with interfaces, async/await done right with CancellationToken threading, immutability with records, the options pattern for configuration, and proper repository implementations with EF Core. The examples are realistic, showing both good and bad approaches. Use this when you want Claude to write .NET code that follows modern conventions instead of generating the mutable-everything, sync-over-async antipatterns that plague a lot of codegen. The result pattern section alone is worth having loaded if you're tired of exception-driven control flow.
- skills.sh installs
- 5.6K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill dotnet-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
.NET Development Patterns
Idiomatic C# and .NET patterns for building robust, performant, and maintainable applications.
When to Activate
- Writing new C# code
- Reviewing C# code
- Refactoring existing .NET applications
- Designing service architectures with ASP.NET Core
Core Principles
1. Prefer Immutability
Use records and init-only properties for data models. Mutability should be an explicit, justified choice.
// Good: Immutable value object
public sealed record Money(decimal Amount, string Currency);
// Good: Immutable DTO with init setters
public sealed class CreateOrderRequest
{
public required string CustomerId { get; init; }
public required IReadOnlyList<OrderItem> Items { get; init; }
}
// Bad: Mutable model with public setters
public class Order
{
public string CustomerId { get; set; }
public List<OrderItem> Items { get; set; }
}
2. Explicit Over Implicit
Be clear about nullability, access modifiers, and intent.
// Good: Explicit access modifiers and nullability
public sealed class UserService
{
private readonly IUserRepository _repository;
private readonly ILogger<UserService> _logger;
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Category
- .NET & C#
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Blueprint5.5K
- Ecc Guide5.5K
- Code Tour5.5K
- Nuxt4 Patterns5.5K
- Healthcare Phi Compliance5.5K
- Inventory Demand Planning5.5K
- Agentic Os5.5K
- Product Capability5.5K
- Security Bounty Hunter5.5K
- Ai First Engineering5.5K
- Prisma Patterns5.5K
- Continuous Agent Loop5.5K
- Continuous Learning5.5K
- Agent Eval5.5K
- Exa Search5.5K
- Agent Sort5.5K
- Product Lens5.5K
- Iterative Retrieval5.5K
- Skill Stocktake5.5K
- Benchmark5.5K
- Healthcare Emr Patterns5.5K
- Homelab Network Setup5.5K
- Ios Icon Gen5.5K
- Kotlin Ktor Patterns5.5K