dotnet-patterns

Standardize C# and .NET development with idiomatic patterns and dependency injection.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill dotnet-patterns-thejanajayalath
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-patterns
Source: https://github.com/ThejanaJayalath/Niolla-PM-system/tree/main/.cursor/skills/dotnet-patterns
Command: npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill dotnet-patterns-thejanajayalath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of maintaining large-scale .NET applications by providing standardized, idiomatic patterns that reduce technical debt and architectural drift.

Core Features & Use Cases

  • Architectural Guidance: Implements clean dependency injection, repository patterns, and middleware pipelines to ensure separation of concerns.
  • Best Practices: Enforces modern C# standards including immutability, async/await safety, and the Result pattern for error handling.
  • Use Case: When refactoring a legacy service or starting a new ASP.NET Core project, use this skill to ensure your service boundaries, configuration management, and API endpoints follow industry-standard conventions.

Quick Start

Apply the dotnet-patterns skill to refactor the current service class to use constructor injection and proper async/await patterns.

Frequently Asked Questions about dotnet-patterns

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

FAQPage Schema
How do I refactor a legacy ASP.NET Core service to use dependency injection?

To refactor legacy ASP.NET Core services with dependency injection, standardize constructor injection and apply repository patterns to enforce separation of concerns. This approach reduces technical debt by establishing clear service boundaries and ensuring explicit configuration management.

What is the Result pattern for error handling in C# and when should I use it?

The Result pattern for error handling in C# provides structured, explicit error returns instead of relying on exceptions. Use this pattern in ASP.NET Core services and minimal APIs to enforce robust architectural conventions and ensure code maintainability across large-scale applications.

How do I structure a new .NET project using minimal APIs and clean architecture?

Structure a new .NET project by implementing clean dependency injection, repository patterns, and middleware pipelines for separation of concerns. This ensures minimal APIs and data access layers follow industry-standard conventions, preventing architectural drift in large-scale applications.

Does ASP.NET Core support async/await safety and immutability for data access layers?

ASP.NET Core supports async/await safety and immutability by enforcing modern C# standards within data access layers. Applying these conventions ensures robust, maintainable service boundaries and prevents architectural drift when designing or refactoring applications.

How do I fix architectural drift and technical debt in large-scale C# applications?

Fix architectural drift and technical debt in large-scale C# applications by standardizing development through idiomatic patterns and dependency injection. Enforcing explicit nullability, immutability, and structured error handling reduces complexity and maintains clear service boundaries.