Does your heart sink when you're asked to make "small changes" to your ASP.NET applications?

There's so much code; making "small" changes takes days and you're frustrated because you can't turn requests around quickly enough....

From layers to vertical slices

You know the feeling; a boss/customer/product owner calls and says:

"This is just a small change, I can't imagine it would take more than half an hour or so?"

And your heart sinks, because you know what these "small" tweaks actually entail.

You've done this dance many times before.

If you're lucky, you can locate the relevant ASP.NET controller, but you know that's only the start.

As you dive further and further through your application's layers into the depths of your codebase, you begin to question your life choices.

Wait, didn't I see this service already? UserManagerFactory again?! Maybe the ManagerRepositoryHelper has the answer.

3 hours later, you're knee-deep in your Data Access Layer, desperately trying to figure out where this "small tweak" needs to be made, wondering if it's lunchtime yet.

Do you need all those layers?

It doesn't have to be this way! You can skip a lot of this pain by leveraging the idea of "vertical slices".

When you build and architect your application around individual features, using vertical slices, magical things start to happen!

  • You always know exactly where to look for the code that makes any given feature tick
  • You get to work with (and write) simple code
  • When it comes to implementing new features you get to focus on the feature (not mountains of boilerplate code)
  • You can use tests to be confident your feature actually does what the user/customer wants it to do (imagine that!)
  • You can get all your work done in a few hours and bunk off early (OK, maybe not, but it's good to dream...)

Discover vertical slices for yourself

I've been using vertical slices for several years now, and have come to really appreciate their simple, yet powerful elegance.

Now I'm delighted to share that experience with you so you can enjoy the feeling that comes from knowing you can turn any feature request into working software (and still understand the code when you come back to it in 6 months!)

"From Layers to Vertical Slices" will get you up and running in just a few hours. Read it today and you can start using vertical slices to simplify your code tomorrow.

What's Included

Here's the complete contents listing for the book...


Just another Monday Morning

Mind the gap

Why your projects devolve into a hot mess


Conditional logic == harder to reason about the code


One model, multiple uses


Cascading failure


Ever expanding classes


Entropy will have its way...

Step 1 - Use Feature Folders

You have an "in"

You can see how "big" a feature is

See what features exist

Decrease re-use

Your focus is shifted!

Razor Pages does this already

Step 2 - Use vertical slices

Fall into the pit of success

Creating minimal structure (guide rails) with MediatR

More accurate terminology

Specific representation of your data

But where does the actual logic go?

Use MediatR to "send" your requests

Not just queries

Wire up the command

Build better software with vertical slices

Encapsulate by feature

Single purpose models

Focus on your features

Refactor by feature

DRY is overrated

Storage is cheap, and context is key

Vertical slices all the way down

Take Action - Use Feature Folders
Take Action - Build a feature using vertical slices with MediatR

Wire up MediatR

Create your feature

Next Steps

Applying the vertical slices approach to your own projects

Start with something simple

Migrate existing queries

Migrate existing commands

Further reading (including thoughts on testing your slices)

A word on testing vertical slices

In conclusion - There are no silver bullets
Download the demo Helpdesk app

From Layers to Vertical Slices


Simplify your code, focus on your features

  • Instant online access
  • PDF version for offline reading
  • Example source code