Goodbye Controllers: Building Better Blazor Web Apps with Vertical Slices

Streamline Your .NET 8 Projects with the Power of MediatR and Blazor

Rico Fritzsche
Level Up Coding

Image licensed under the Unsplash+ License.

In this article, I want to revisit how the Vertical Slice Architecture can be used. This article takes an in-depth look at feature slicing and its application to server-side rendered (SSR) .NET 8 Blazor pages without the need for a controller class. You’ll find clear explanations and practical advice on several key points:

  1. An understanding of what Vertical Slice Architecture is and how it works within the .NET ecosystem using the power of the MediatR library.
  2. Insight into the distinctions between vertical slices and microservices, and when each is appropriate.
  3. The reasons why the traditional controller-based model may not be necessary in modern web app design.
  4. A practical, hands-on walkthrough for crafting a Razor page that leverages the vertical slice approach, offering a concise and independent feature slice for better maintainability and scalability.

By the end of this article, you should have a thorough understanding of vertical slice architecture and be well equipped to use it in your .NET 8 Blazor projects to increase their robustness and modularity.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Rico Fritzsche

Building the Future of Location-Based Intelligence. Entrepreneur. Tracking/Geofencing API B2B Services.

Responses (5)

What are your thoughts?

This approach has several interesting points, thank you for sharing.

The example is very simple, but could be interesting to see how to manage all the cross cutting concerns and complexities present in a non trivial application.

I’m not a big fan…

The Vertical Slices introduced in this article are similar to modular monolithic for me.

This looks like ASP from the early 2000s :D