DotNet By Ajay — New: ES2025 cheat-sheet is live!
Showing posts with label Dependency Injection. Show all posts
Showing posts with label Dependency Injection. Show all posts

July 3, 2026

C# 12 Primary Constructors: Features, Examples & Best Practices

C# 12 Features - Primary Constructors
C# 12 Features - Primary Constructors

Primary constructors are one of the most useful features introduced in C# 12 using the latest Visual Studio 2022 version or the .NET 8 SDK. They reduce constructor boilerplate, especially in Dependency Injection (DI) scenarios, making your code cleaner without changing how objects are created.

June 13, 2025

🧠 Why You Should Use IConfiguration Instead of Hardcoding Settings in .NET