In this case, I’m creating a HostedService which is a BackgroundService. It provides all the same goodness that you get with an ASP.NET Core app such as Dependency Injection and Logging. The Worker is using the Generic Host which is very similar to the WebHost from ASP.NET Core. I’ll cover message processing in other blogs/videos as the purpose of this post is simply the solution and project structure.Īs you can expect, it will reference the implementation projects and use the extension methods just as the AspNetCore project does. Its purpose is to connect to a message broker and dispatch the relevant messages to the implementation projects. The Message Processor (Worker) is the other top-level project that is a console application. This can then be used in the AspNetCore’s ConfigureServices. In the case above it’s adding the Entity Framework SalesDbContext. The above example is of an extension method for defining all of the types that needed to be registered with a ServiceCollection. Things like Dependency Injection, HTTP routing, etc.
![folder structure diagram video folder structure diagram video](https://imgscf.slidemembers.com/docs/1/1/593/human_infographic_organizational_chart_powerpoint_presentation_video_592531.jpg)
This is because each implementation project must define its own configuration. The mentioned this project will reference the Sales and Shipping projects. Which is really just basically a console app using Kestrel as the HTTP server. This top-level project is an ASP.NET Core app. Top-level projects will reference the implementation projects to expose their capabilities AspNetCore and a Message Process (Worker). There are two top-level projects that are our executable projects. The example above has the Sales implementation referencing the Shipping.Contracts. They will never reference another implementation project. All 6 projects are C# Class Libraries.Įach implementation project (Sales & Shipping) will only reference other Contract projects. For each one, I’ve created a solutions folder which the 3 respective projects for each boundary inside. In my example above, there are 2 boundaries: Sales, and Shipping. Each boundary contains 3 projects: Contracts, Implementation, and Tests.
![folder structure diagram video folder structure diagram video](https://docs.alfresco.com/content-services/images/sf-workflow.png)
These boundaries should define the set of capabilities of your system. The middle row of the diagram has 3 boxes that represent a boundary. Here’s a diagram of what the Solution and C# project structure should reflect. Video can’t be loaded because JavaScript is disabled: Solution & Project Structure of a Loosely Coupled Monolith ()