W

dotnet-backend-patterns

by wshobson

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

Stars32.4K
Favorites0
Comments0
AddedMar 28, 2026
CategoryBackend Development
Install Command
npx skills add https://github.com/wshobson/agents --skill dotnet-backend-patterns
Overview

Overview

What is dotnet-backend-patterns?

dotnet-backend-patterns is a comprehensive skill for mastering backend development in C#/.NET. It provides practical patterns and best practices for building production-ready APIs, MCP servers, and enterprise applications. The skill focuses on modern .NET techniques, including async/await, dependency injection, Entity Framework Core, Dapper, configuration management, caching strategies, and automated testing with xUnit.

Who Should Use This Skill?

  • .NET backend developers building new APIs or services
  • Teams reviewing C# code for maintainability and performance
  • Architects designing scalable, testable backend solutions
  • Developers optimizing data access and caching

Problems Solved

  • Establishes clean architecture for .NET projects
  • Guides on dependency injection and service registration
  • Optimizes database access with EF Core and Dapper
  • Implements caching with Redis and memory cache
  • Provides patterns for configuration, error handling, and resilience
  • Supports robust testing with xUnit

How to Use

Installation Steps

  1. Add the skill to your agent or project with:
    npx skills add https://github.com/wshobson/agents --skill dotnet-backend-patterns
  2. Start by reading SKILL.md for a high-level summary and workflow.
  3. Review README.md, AGENTS.md, and metadata.json for additional context if available.
  4. Explore the assets/ folder for code templates:
    • repository-template.cs for repository patterns
    • service-template.cs for service layer structure
  5. Consult references/ for in-depth guides:
    • dapper-patterns.md for high-performance Dapper usage
    • ef-core-best-practices.md for EF Core optimization

Adapting to Your Project

  • Use the provided templates and references as a starting point.
  • Adjust patterns to fit your repository structure, business logic, and infrastructure.
  • Integrate dependency injection, caching, and testing according to your application's needs.

Key Concepts Covered

  • Clean architecture project structure for maintainable code
  • Dependency injection setup and best practices
  • Advanced data access with Dapper and EF Core
  • Caching strategies using Redis and memory cache
  • Application configuration with the IOptions pattern
  • Unit and integration testing with xUnit

FAQ

When should I use dotnet-backend-patterns?

Use this skill when starting new .NET backend projects, refactoring legacy code, or standardizing backend practices across teams. It's especially valuable for projects requiring scalable APIs, robust data access, and maintainable architecture.

What files or folders are most important?

Begin with SKILL.md for an overview. For implementation details, check assets/repository-template.cs, assets/service-template.cs, and the references/ folder for best practices in Dapper and EF Core.

Does this skill cover both EF Core and Dapper?

Yes. It provides side-by-side guidance on when to use EF Core versus Dapper, including performance considerations and code samples for each.

Is this skill suitable for microservices?

Yes. The patterns and practices are applicable to both monolithic and microservice architectures in .NET.

Where can I find more examples?

Open the Files tab to browse all templates, references, and helper scripts included with dotnet-backend-patterns.

Ratings & Reviews

No ratings yet
Share your review
Sign in to leave a rating and comment for this skill.
G
0/10000
Latest reviews
Saving...