dotnet-patterns

Apply idiomatic C# patterns and best practices to .NET code.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/khunglong-03/Pathora_Version3 --skill dotnet-patterns-khunglong-03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-patterns
Source: https://github.com/khunglong-03/Pathora_Version3/tree/main/.cursor/skills/dotnet-patterns
Command: npx skills add https://github.com/khunglong-03/Pathora_Version3 --skill dotnet-patterns-khunglong-03

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams adopt idiomatic C# and .NET patterns to produce reliable, scalable, and maintainable code rather than ad-hoc implementations.

Core Features & Use Cases

  • Immutability by using records and init-only properties for data models.
  • Explicitness in nullability, access modifiers, and intent.
  • Dependency inversion through abstractions and DI container registration.
  • Async/Await usage patterns and parallel task coordination with Task.WhenAll.
  • Repository pattern guidance with EF Core examples and clean architecture concepts.

Quick Start

Refactor a sample .NET module to apply idiomatic patterns starting with immutable data models and explicit access modifiers.

Frequently Asked Questions about dotnet-patterns

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

FAQPage Schema
How do I implement idiomatic C# patterns for maintainable .NET code?

Idiomatic C# patterns enforce immutability using records, explicit nullability, and dependency inversion via abstractions to produce maintainable .NET code. This approach replaces ad-hoc implementations with standardized, reliable architectural practices.

What is the best way to use async await and Task.WhenAll for parallel coordination in C#?

Async await patterns in C# enable disciplined parallel task coordination using Task.WhenAll. This approach ensures scalable asynchronous operations by properly managing concurrent execution flows without blocking threads.

How do I refactor C# code to use immutable records and init-only properties?

Refactoring C# code to use immutable records and init-only properties involves updating data models to enforce explicit access modifiers. This ensures explicitness in nullability and intent throughout the service architecture.

Does this approach to dependency inversion work with ASP.NET Core and EF Core?

Dependency inversion via abstractions works seamlessly with ASP.NET Core and EF Core. It guides repository pattern implementation and DI container registration to support clean architecture concepts across enterprise scenarios.

When should I not use the repository pattern in EF Core .NET applications?

The repository pattern in EF Core .NET applications may be unnecessary for simple CRUD operations where DbContext already acts as a repository. Overusing it can add redundant abstraction layers without clear architectural benefits.