๐Ÿ”ฅ Pragmatic .NET Code Rules Course is on Presale - 50% off!BUY NOW
Free .NET 10 template
FREE production-ready project template

Vertical Slice Architecture in .NET 10.
Zero unnecessary abstractions.

A VSA API template with 10 endpoints, 2 feature domains, and only 5 NuGet packages. No MediatR. No FluentValidation. No AutoMapper. Just clean .NET.

Send me the FREE template now
โœ“17 source filesโœ“10 endpointsโœ“5 NuGet packages
See it work

One file per feature, running

Click a command to watch the template in action.

bash ยท vertical-slice-api
โตโต auto-accept edits on
โฏ
src/
โ”œโ”€ Features/
โ”‚ โ”œโ”€ Newsletters/
โ”‚ โ”‚ โ”œโ”€ CreateNewsletter.cs # request + handler + endpoint
โ”‚ โ”‚ โ”œโ”€ PublishNewsletter.cs
โ”‚ โ”‚ โ””โ”€ GetNewsletters.cs # projection query
โ”‚ โ””โ”€ Subscribers/
โ”‚ โ”œโ”€ AddSubscriber.cs
โ”‚ โ””โ”€ GetSubscribers.cs
โ”œโ”€ Common/
โ”‚ โ”œโ”€ ValidationFilter.cs # generic IEndpointFilter
โ”‚ โ””โ”€ Error.cs # ProblemDetails
โ”œโ”€ Infrastructure/AppDbContext.cs # EF Core 10 + PostgreSQL
โ””โ”€ Program.cs # route groups + Scalar
0
Source files
0
Endpoints
0
Feature domains
0
NuGet packages

What's inside the template

A real project, not a toy example

Two complete feature domains, 10 fully functional endpoints, and zero bloat.

โœ“ Self-contained feature slices

Each feature file contains its Request DTO, validation rules, handler logic, and endpoint mapping - all in one place. Add a feature? Add a file. Delete a feature? Delete a file.

โœ“ Minimal APIs with route groups

No controllers, no attributes - just lambdas and route groups. Clean composition under /api/newsletters and /api/subscribers with shared OpenAPI tags.

โœ“ Built-in validation with DataAnnotations

A single generic ValidationFilter<T> handles validation for the entire API. Add [Required], [StringLength], [EmailAddress] to any request record - done.

โœ“ ProblemDetails error responses

Standard RFC 9457 error format. Structured Error records with {Feature}.{Reason} codes - easy to trace, easy to handle on the client.

โœ“ Only 5 NuGet packages

No MediatR. No FluentValidation. No AutoMapper. No Carter. Zero unnecessary abstractions - only what .NET gives you out of the box.

โœ“ EF Core 10 + PostgreSQL

Code-first with typed DbContextOptions, explicit entity configuration with HasMaxLength constraints, sealed DbContext, and auto-migrations in dev.


The stack

Modern .NET, nothing exotic

.NET 10

Latest LTS framework

Minimal APIs

Lightweight, high-performance endpoints

EF Core 10

ORM with code-first migrations

PostgreSQL

Database provider via Npgsql

Scalar

Modern API documentation (replaces Swagger)

DataAnnotations

Built-in request validation


What you'll learn

Skills you keep after the download

โœ“How to structure a .NET 10 API using Vertical Slice Architecture

โœ“How to use Minimal APIs with route groups for clean endpoint composition

โœ“How to implement validation without FluentValidation using DataAnnotations + endpoint filters

โœ“How to organize Commands and Queries within feature slices (lightweight CQRS)

โœ“How to handle errors with structured error types and proper HTTP status codes

โœ“How to build a production-ready API with only 5 NuGet packages


Patterns inside

Battle-tested patterns, applied

Vertical Slice Architecture

Features organized by business capability, not technical concern

CQRS (lightweight)

Commands and Queries separated into subfolders per feature

Endpoint Filters

Cross-cutting validation via generic IEndpointFilter

Immutable DTOs

All request/response types are sealed records

RESTful API Design

Correct HTTP verbs, status codes (201, 200, 204, 404, 409)

Projection Queries

.Select() projections instead of loading full entities for reads


What is this exactly?

A production-ready starter Vertical Slice Architecture API template built with .NET 10 and Minimal APIs. Two complete feature domains - Newsletters (full CRUD + Publish) and Subscribers (full CRUD) - with 10 fully functional endpoints, structured error handling, and modern API docs via Scalar.

Who is it for?

.NET developers who want to move beyond traditional N-layer / Clean Architecture. Backend engineers looking for a lightweight, maintainable API structure. Teams that want each feature independently buildable - and anyone tired of jumping between 5+ files to understand one feature.

One file per feature. Ship faster.

The full .NET 10 VSA template, free, in your inbox.

Send me the template

No credit card ยท unsubscribe anytime