dotnet-patterns

Explain idiomatic C# and VB.NET patterns for .NET Framework and modern .NET.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/flatrick/mdt --skill dotnet-patterns-flatrick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-patterns
Source: https://github.com/flatrick/mdt/tree/main/skills/dotnet-patterns
Command: npx skills add https://github.com/flatrick/mdt --skill dotnet-patterns-flatrick

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance on writing clean, efficient, and maintainable C# and VB.NET code, covering modern best practices and common pitfalls.

Core Features & Use Cases

  • Modern C# Features: Explains records, nullable reference types, async/await, LINQ, and more.
  • VB.NET Idioms: Highlights differences and best practices for VB.NET developers.
  • Testing & Refactoring: Includes patterns for unit testing with xUnit and Moq.
  • Use Case: A developer is unsure about the best way to implement asynchronous operations in a new .NET Core service. They consult this Skill for examples of async/await best practices, ConfigureAwait(false), and Task.WhenAll.

Quick Start

Use the dotnet-patterns skill to learn about using records for immutable data in C#.

Frequently Asked Questions about dotnet-patterns

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

FAQPage Schema
What is the best way to implement async/await in .NET to avoid common pitfalls?

The best way to implement async/await in .NET involves using ConfigureAwait(false) in library code and Task.WhenAll for concurrent operations. This Skill provides comprehensive guidance on asynchronous best practices to ensure your C# code remains clean and efficient.

How do I use C# records for immutable data in modern .NET?

To use C# records for immutable data, you define reference types with value-based equality semantics. This Skill explains modern C# features like records and nullable reference types, offering quick start examples for implementing immutable data structures.

Does this .NET guidance cover both .NET Framework 4.8 and modern .NET versions?

Yes, this .NET guidance covers both .NET Framework 4.8 and modern .NET versions including 5, 6, 7, and 8+. It provides idiomatic C# and VB.NET patterns, best practices, and conventions applicable across these different framework versions.

How do I structure unit testing with xUnit and Moq for C# enterprise patterns?

You structure unit testing with xUnit and Moq by following established testing strategies and enterprise patterns. This Skill includes specific patterns for unit testing and refactoring C# code to help you write maintainable tests.

What are the differences in best practices between C# and VB.NET idioms?

The differences in best practices between C# and VB.NET idioms involve distinct language-specific conventions and syntax handling. This Skill highlights these differences and provides tailored best practices for VB.NET developers transitioning or working alongside C#.

When should I use Entity Framework Core conventions in my .NET service?

You should use Entity Framework Core conventions when implementing data access layers in .NET services. This Skill covers EF Core patterns alongside dependency injection and LINQ best practices to help you structure your enterprise applications.