Skip to main content

Posts

Showing posts with the label clean architecture vs vertical slice

Vertical Slice Architecture in .NET: A Complete Guide

Learn vertical slice architecture in .NET with C# examples. Organize code by feature, not layer — with MediatR, minimal APIs, and best practices. Start now! What Is Vertical Slice Architecture in .NET? Vertical slice architecture is a way of organizing your .NET codebase by feature instead of by technical layer . Rather than spreading a single feature across a Controllers folder, a Services folder, a Repositories folder, and a DTOs folder, you put everything that feature needs — the endpoint, the request, the handler, the validation, and the data access — into one folder, one "slice." When you need to change how "Create Order" works, you open one folder, not five projects. The term was popularized by Jimmy Bogard (creator of MediatR and AutoMapper), and it has become one of the most talked-about approaches to ASP.NET Core project structure. In this guide, you'll learn why vertical slice architecture is winning over teams that used to swear by n-tier and ...