C# Architecture Mastery — Architecture Smells in ASP.NET Core (Part 5)
Source: Dev.to

Most ASP.NET Core projects compile and many even work, but under the surface they can rot due to architecture smells—patterns that feel productive early and become catastrophic later. In this part we dissect the three most common smells seen in real‑world ASP.NET Core systems:
- Fat Controllers
- God Services
- DbContext Leaks
These are not merely style issues; they are scalability and correctness problems.
1. What an Architecture Smell Really Is
An architecture smell is a structural warning sign that the system will resist change, testing, or scaling.
Why smells are dangerous
- They feel “reasonable” at first.
- They often pass code review.
- They grow silently.
Clean Architecture is largely about eliminating smells before they spread.
2. Fat Controllers — The Most Common Smell
The Smell
Controllers that contain business rules, orchestrate workflows, or talk directly to the database. They also perform validation, mapping, and logic.
// ❌ Fat controller
[HttpPost]
public async Task Create(OrderDto dto)
{
if (dto.Total `.
}
The Fix
- Move business logic to dedicated services.
- Keep controllers thin: receive input, call services, return results.
- Use DTOs and mapping libraries (e.g., AutoMapper) outside the controller.
7. Smell Detection Checklist (Use in Code Reviews)
Ask these questions:
- Does this controller contain logic?
- Does any service feel “too important”?
- Is
DbContextvisible outside Infrastructure? - Do business rules depend on EF features?
- Would this be testable without ASP.NET Core?
If the answer is yes, you’ve found a smell.
8. Smells Are Architectural Debt
Unlike ordinary technical debt, smells:
- Compound over time.
- Spread to other parts of the codebase.
- Infect new code.
Ignoring them early guarantees pain later.
9. Clean Architecture Is Mostly Subtraction
Great architecture is not about adding layers; it’s about removing responsibilities from the wrong places:
- Thin controllers.
- Focused services.
- Isolated infrastructure.
Final Thoughts
If your ASP.NET Core app has any of the following:
- Fat controllers
- God services
- DbContext leaks
It may work today, but it will fight you tomorrow. Recognizing these smells early is one of the strongest signals of senior engineering maturity.
Written by Cristian Sifuentes — helping teams identify architectural decay before it becomes irreversible.