You've heard about Clean Architecture before? In this video, I'm going to show you how to set up the Clean Architecture using .NET 6 and CQRS with MediatR. Support me on Patreon to access the source code: 🤍🤍patreon.com/milanjovanovic Join my weekly .NET newsletter: 🤍🤍milanjovanovic.tech Subscribe for more: 🤍🤍youtube.com/c/MilanJovanovicTech?sub_confirmation=1 Chapters 0:00 Introduction 0:19 What is the Clean Architecture? 2:51 Domain layer 5:01 Application layer 7:26 Infrastructure layer 8:25 Presentation layer 12:02 Outro
This introduction part is great. KUDOS TO YOU...
Where is the next video for implementation part ???
What if database is responsible for generating Id for newly created resources? Do we completely remove the parent Entity class? How does it look in DD approach?
Nice, I use Node JS thought but this content its pure gold, not many channels have videos on how to implement clean arch. Keep rocking!
I'm still a beginner, trying to follow your code. however at tLk4pZZtiDY&t=04m15s 04:15 min I didn't find the NotFoundException class could you please give me a hint.
Thank you Chris. I really appreciate it and that was exactly what I was trying to do. No fuss and helping people get on with what they need
How can I create library project for web Controllers? Last version of nuget Microsoft.AspNetCore.Mvc is outdated (2.2.0 version). If I use in csproj sdk=Microsoft.NET.Sdk.Web, during build it asks for Main method as an entry point. Is there any way to create library project with Microsoft.AspNetCore.Mvc namespace available?
Can you please please show how to setup Serilog logging in this project structure throughout all the projects?
I used to onion architecture before , and I realize that both are the same, I confused, would you explain the different please?
I like the "trick" of separating the Presentation layer from the composition root. But there are also two things that I'm not so sure about:
1. Don't you think, that persistence-related abstractions, like IRepository and IUnitOfWork should be placed in the Application layer, instead of the Domain layer?
I think that the Domain layer shouldn't know anything about the persistence, even if it's only a contract. In fact, the Domain layer doesn't have to know if it's persisted at all :)
2. Some persistence logic in your QueryHandler in the Application layer - shouldn't we move it to the Infrastructure layer?
Persistence logic is in fact something related to external dependencies, so you're breaking the idea of separating the Application layer exposing interfaces from the Infrastructure layer containing implementations related to all external concerns.
Also, I would consider making your Application layer more explicit and using Result monads instead of relying on middleware from the Web project to catch everything and translate it to a proper response code. This is not entirely bad, but at least opinionated in the community : )
Place the handlers and commands/queries in same clases , less classes more clean code
Excellent tip on the controllers Assembly. Good stuff!
The video is great, the core concepts explaination is fantastic, but unfortunately the project is big and I guess it has some unneeded parts which add extra complexity, like why are the parts made as seperate projects with bunch of folders inside them and not just a direct folder or project containing the code itself?
Hello, buddy. Congrats for the video! Any special reason to use .NET Core 5 instead of 6? Or, are you using 6 with a startup class?
Can you help to run the debugger through all of these layers so developers can understand how powerful is it? Thanks
Great video Milan! Thank you so much for sharing.
I lke it :) Thank you
Great video , please keep posting videos like this.