Publishing Every 3 Weeks · ASP.NET Core · Design Patterns · Architecture · 20 yrs C#/.NET · cleancsharp.com
// Topic

Best Practices

The conventions and patterns experienced C#/.NET teams actually follow — and why.

posts
AI & Workflow, Best Practices"> 0
Live AI & Workflow

📋 The Rules File: Governing AI Before It Writes a Line

Your assistant has never seen your outages. It will remove the guard that exists because of one, and the diff will look like an improvement. A rules file is where your postmortems go to live — and most of them are written wrong, because they record taste instead of scars.

Data, Performance, Best Practices"> 1
Live Data

🔁 LINQ Pitfalls: The Query That Ran Twice

The query didn't run when you wrote it. It ran when you looked — and it ran again when you looked again. Deferred execution, multiple enumeration, and the boundary that quietly drags a whole table into memory. Most of these traps reproduce with a List<T> and no database at all.

WebAPI, Best Practices"> 4
Live WebAPI

Building Professional WebAPI Controllers

"Your controller is the first code that touches every request and the last code before every response. Endpoints that work locally fail in production. Here's how to build APIs that scale."

Configuration, Production, Best Practices"> 5
Live Configuration

🔒 Configuration Management That Won't Get You Fired

The DBA noticed the prod connection string in a public GitHub commit. By lunch you were updating LinkedIn. Configuration is the boring infrastructure that ends careers — and it's not that hard to get right. Here's the playbook for IConfiguration, secrets, environments, and rotation.

Async, Production, Best Practices"> 6
Live Async

⚡ Async/Await — Don't Block Your Threads

A waiter who hands the ticket to the kitchen and works the floor can serve a full dining room. A waiter who stands at the kitchen window waiting for one dish starves everyone else. Your API makes the same choice every time you turn async code back into blocking code.

Load more posts