ASP.NET Core: Auth with Middleware or Filters?

Discover how using custom middleware for authentication in ASP.NET Core SaaS APIs leads to cleaner, faster, and more maintainable code compared to traditional authorization filters.

September 12, 2025 · Last modified: September 19, 2025 · 3 min

3 Signs Your Code Needs Middleware

TL;DR Repeating logic across controllers (like logging or header checks)? Move it to middleware. Modifying requests/responses in controllers? Middleware handles that cleanly and early. Your services use HttpContext? Extract that logic into middleware for cleaner, testable code. If your services are bloated or you’re duplicating logic across controllers, middleware might be the extension point you actually need. Many developers reach for filters or services first, when middleware would’ve been faster, simpler, and more maintainable. ...

August 21, 2025 · 2 min

Why Constructor Injection Matters in Clean Architecture

Constructor injection is your first clean architecture decision. Learn how to write testable, decoupled ASP.NET Core code using built-in DI, scoped lifetimes, and mocking techniques.

August 18, 2025 · Last modified: September 19, 2025 · 8 min

Applying OOP in ASP.NET Core

This post explores the four pillars of OOP in ASP.NET Core: encapsulation, abstraction, inheritance, and polymorphism. It provides practical examples and explains how these principles improve code maintainability, testability, and architecture in modern C# web APIs.

August 10, 2025 · Last modified: September 3, 2025 · 8 min
×