dotnet-backend-patterns

Provides guidance and code examples for implementing C#/.NET backend development patterns including Clean Architecture, async/await, DI, EF Core, Dapper, caching, and xUnit testing.

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill dotnet-backend-patterns-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-backend-patterns
Source: https://github.com/wshobson/agents/tree/main/plugins/dotnet-contribution/skills/dotnet-backend-patterns
Command: npx skills add https://github.com/wshobson/agents --skill dotnet-backend-patterns-wshobson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and code examples for building robust, scalable, and maintainable C#/.NET backend applications, addressing common architectural challenges and best practices.

Core Features & Use Cases

  • Architectural Patterns: Implement Clean Architecture, Dependency Injection, and asynchronous programming.
  • Data Access: Master Entity Framework Core and Dapper for efficient data persistence.
  • Caching & Resilience: Implement caching strategies and robust error handling.
  • Testing: Write effective unit and integration tests.
  • Use Case: When developing a new microservice, use this Skill to ensure you're following modern .NET best practices for DI, data access, and async operations, leading to a more reliable and performant service.

Quick Start

Use the dotnet-backend-patterns skill to generate a C# example for implementing dependency injection with IOptions.

Frequently Asked Questions about dotnet-backend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Clean Architecture in a .NET backend application?

Clean Architecture in a .NET backend separates concerns into distinct layers, ensuring dependency inversion and maintainable enterprise APIs. This Skill provides in-depth guidance and code examples to structure your C# application following these modern architectural boundaries.

What's the best way to choose between Entity Framework Core and Dapper for data access?

Choosing between Entity Framework Core and Dapper for .NET data access depends on your need for abstraction versus raw performance. This Skill provides code examples mastering both ORM and micro-ORM patterns for efficient data persistence.

How do I configure dependency injection using IOptions in C#?

Configuring dependency injection in C# with IOptions binds strongly-typed configuration settings to your service classes. You can use this Skill to generate a C# example implementing DI with IOptions for robust application settings.

Can I use asynchronous programming with async/await to improve API scalability?

Asynchronous programming with async/await improves API scalability by freeing threads during I/O operations. This Skill offers guidance on implementing these patterns to build performant and scalable .NET backend services.

How do I write effective unit and integration tests for .NET APIs?

Writing effective tests for .NET APIs involves using xUnit to validate both individual components and integration flows. This Skill provides comprehensive testing guidance to ensure your backend application remains robust and maintainable.

When should I implement caching strategies in my .NET backend?

Caching strategies in a .NET backend should be implemented to reduce database load and improve API response times. This Skill addresses how to integrate caching and robust error handling for resilient enterprise applications.