-
Book Overview & Buying
-
Table Of Contents
An Atypical ASP.NET Core 5 Design Patterns Guide
By :
Context: We are getting tired of layering, and we got asked to rebuild our small demo shop using Vertical Slice Architecture.
Here is an updated diagram that shows how the project is conceptually organized:
Figure 15.2 – Diagram representing the organization of the project
Each vertical box is a use case (or slice), while each horizontal arrow is a crosscutting concern or some shared components. This is a small project, so the data access code (DbContext) and the Product model are shared between all use cases. That sharing has nothing to do with Vertical Slice Architecture, but as a tiny project, it is hard to split it up more. I'll go into more detail at the end of the section.
Here are the actors:
ProductsController is the web API entry point to manage products.StocksController is the web API entry point to manage inventory (add or remove stocks).AddStocks, RemoveStocks, and ListAllProducts...