Clean Architecture Project Setup From Scratch With .NET 7

Clean Architecture Project Setup From Scratch With .NET 7

Milan Jovanović

1 год назад

120,376 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

bmeks
bmeks - 18.09.2023 17:25

Hi Millan, I want to test the Migrations file inside the "Persistence" project on my database.
I wonder how to operate cli through the value set in appSetting.json

Ответить
Xustis
Xustis - 14.09.2023 21:02

Thanks for the video. Can I create a web application that use that api directly or should i use web application controllers to call this api by client clases for example? If i can use it direcctly i am not sure if domain should contain logic like ViewModels, resources, etc. Very difficult to find Api with ddd and web application integration, everybody only talk about the api and i am so confused.

Ответить
Subhrajit Mazumder
Subhrajit Mazumder - 13.09.2023 03:30

@MilanJovanovicTech Thanks for giving us this wonderful video. Also I have a question, when I go to register the "AddPresentation()" or "AddInfrastructure()" or "AddApplication()" inside the program.cs file, it gives me an error : 'IServiceCollection' does not contain a definition for 'AddPresentation' and no accessible extension method 'AddPresentation' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)'. Also, I have references all three projects inside the WebAPI project.

Ответить
Üsame Savas
Üsame Savas - 12.09.2023 22:19

I think splitting the infrastructure layer to multiple projects for each infrastructural concern (database, email gateway, other external apis) looks more maintainable. I did that in a few projects and helped me better organize and understand my codebase (inspiring from the "screaming architecture")

Ответить
Angell Dark
Angell Dark - 06.08.2023 18:02

Hi Mr.Milan.
I can use the presentation as wpf

Ответить
Said ID BESSLAM
Said ID BESSLAM - 02.08.2023 15:52

Hi Milan,
thanks for the video!
I have just one question though, why didn't you reference application project in infrastructure project?
(PS: I am new with clean architecture concepts)

Ответить
Ria tec
Ria tec - 30.07.2023 09:39

Hi Milan,
can you suggest few good ways how to define the event flow between the 4 layers of CA in a diagram

Ответить
Kashif Reza
Kashif Reza - 26.07.2023 21:22

Have you ever used MediatR in production? How was you experience with MediatR in terms of performance and memory consumption in case of high traffic?

Ответить
Ivan Fernando Paz
Ivan Fernando Paz - 23.07.2023 23:38

how can apply this on my frontend project with react or any framework?

Ответить
Casey_Spaulding
Casey_Spaulding - 16.07.2023 15:35

Thanks. Best explanation I have found. Simple to the point

Ответить
Carlos Washington Mercado
Carlos Washington Mercado - 13.07.2023 23:06

You (may) forgot to make the cursor visible. Great video. I'm subscribing.

Ответить
W
W - 13.07.2023 22:09

Hello, good video. At which layer would you place a payment API interface and implementation?

Ответить
unkn0wn Rαge
unkn0wn Rαge - 07.07.2023 08:06

Do you think a new project for each layer is a good design?

Ответить
Sandra Gredo
Sandra Gredo - 05.06.2023 19:11

Gde si sve NAUCIO, POLA NE AZUMEM?

Ответить
David Rodriguez
David Rodriguez - 27.05.2023 19:29

Thanks for the video, clear and direct, I liked the theme that you have applied, can you share the name please?

Ответить
Golden Hits
Golden Hits - 23.05.2023 09:45

Hi ,Milan, Have you done any crude operations on this architecture ?

Ответить
Ronie Nogueira
Ronie Nogueira - 12.05.2023 17:39

Thanks for sharing.
Do you going to continue evolve this application?

Ответить
Abdifatah Abdirahman
Abdifatah Abdirahman - 08.05.2023 15:56

It will be great if you maybe implement 1 entity for that architecture(CRUD)

Ответить
Abdifatah Abdirahman
Abdifatah Abdirahman - 08.05.2023 15:55

Clean architectur subjective, so it's different for a lot of people.

Personally Mine is as Fellows(Folder structures)

Sol-Folder
Entities
Services
DTO(AddReq/EditReq/Res for each Entity plus some custom ViewModels)
Interfaces
Helpers
actual Services.....
Main Project
areas(if req)

Ответить
Steve Ngai
Steve Ngai - 01.05.2023 01:08

Hi, what is your approach to project setup for microservices?

Ответить
Brindo HARMONIZIO
Brindo HARMONIZIO - 30.04.2023 19:20

Thanks but ideally, as expected in Clean Architecture of Uncle Bob : the Application Layer should be TECHNOLOGY AGNOSTIC, so in this layer : no dependency injection Tool, no Mediatr, and so on. All of this should go into the Infra Layer !

Ответить
Iosif Balla
Iosif Balla - 13.04.2023 13:17

Hey Milan, first of all I like very much your videos :). Lately I also feel that the infrastructure indeed should be split in more parts like you did in your presentation: Intrastructure and Presentation and I have a question regarding this or at least I need confirmation for my thoughts :). For the case when I have an Api and a Cli built on top of my whole application then my infrastructure layer would be split in 3: Infrastructure (with core infra stuff), Presentation.Api, Presentation.CLI or? Thank you

Ответить
Andrew Holloway-Breward
Andrew Holloway-Breward - 08.04.2023 17:33

Hi Milan, thanks for this insight into the basic project setup which has been born out of experience. Just embarking on a new project and I am adopting DDD, CQRS and MediatR as having worked on a legacy project for the past 10 years I can see the benefits of this approach and I look forward to future videos!

Ответить
alex g
alex g - 08.04.2023 10:11

Where are the optionsetups added to the iservicecollection? All in application so that infrastructure and persistence can make use of them in their dependency injection class?

Ответить
PROF DAILY
PROF DAILY - 03.04.2023 21:20

enjoying the content, subscribed already

Ответить
James with Web Hosting
James with Web Hosting - 02.04.2023 05:03

If you're serious about building high-quality software applications, this Clean Architecture tutorial is a must-watch - it's packed with practical tips and tricks for setting up your .NET 7 project from scratch.

Ответить
S. Z.
S. Z. - 30.03.2023 05:30

Great one. Could you please extend this video and show us one step further such as how we can add a helloworld endpoint that will fetch data from db and return json response. Basically we wanted to learn where to plant view models, where to put services, where to put repository and make it workable.

Ответить
Valeriy Aleksandrovich
Valeriy Aleksandrovich - 25.03.2023 10:33

API project and Prasentation Layer not same, isn't it? Why create two project which do same mean?

Ответить
Carlos
Carlos - 24.03.2023 21:00

Very good content. Thank you.

Ответить
H Z
H Z - 18.03.2023 18:18

Should dependency inversion interfaces for Application layer live in Domain? Where should they go?

Ответить
Fattima Clan
Fattima Clan - 14.03.2023 14:50

Hello! Thank you for video. I have a question - why dont you refer to application layer from infrastructure layer?

Ответить
Thomas Vieveen
Thomas Vieveen - 14.03.2023 01:33

Someone has been reading Eric Evans and Robert C. Martin! :D Great video Milan!

Ответить
kemal emin
kemal emin - 13.03.2023 15:38

Hi Milan! Thank you for the video. You pasted in the configuration for Serilog but there is a long line that is not visible towards the end. Can you share the whole code elsewhere please?

Ответить
Anton Martynyuk
Anton Martynyuk - 13.03.2023 09:19

When writing for example a microservice or another type of project when all the business logic can only be exposed by webapi calls: I like handling all the validation as a middleware for webapi controllers or minimal APIs. That way your services/CQRS handlers and even domain classes do not need to be populated with validation and checks like the length of the email, etc

Ответить
Jose Antonio Teran Suarez
Jose Antonio Teran Suarez - 09.03.2023 05:36

To fully understand, could you do a CRUD for a single entity? So the communication between layers could be seen better 🙏

Ответить
Sunil Anthony
Sunil Anthony - 09.03.2023 05:31

I still don't get why you would create a presentation layer if you're creating a web API project. I understand it is the entry point and you will register your controllers in the web API project but why? Why not do everything in the web API project?

Ответить
Lasinda Dilshan
Lasinda Dilshan - 07.03.2023 15:36

Great ❤

Ответить
S3Kglitches
S3Kglitches - 06.03.2023 23:32

The purpose of dependency injection is not to give you default settings which you then can use (the DependencyInjection class you created in backend/application layer) but that you inject the dependencies and settings on your own. This means that from the REST API project, you should be configuring the whole backend, no?

Ответить
江宏龙
江宏龙 - 06.03.2023 06:21

What if there are multiple apis or web projects?

Ответить
Simon Shaw
Simon Shaw - 05.03.2023 19:51

Thanks for sharing.
I would love to see how you fill out all the layers in a demo app.

Ответить
Daniel Serafimovik
Daniel Serafimovik - 05.03.2023 19:50

Great Video simple and Clean :)
Good idea will be to record comparison of clean architecture approaches of ardalis vs jason taylor template.
One more idea maybe to record one without use of CQRS and MediatR in the Application layer.
keep up the good work
pozdrav iz Makedonije :)

Ответить
Jose Ramirez
Jose Ramirez - 05.03.2023 17:20

Thanks again Milan, I have a question, if you were to add SignalR to your project where would you put the setup? I mean hubs and stuff

Ответить
sorteslyngel2k
sorteslyngel2k - 05.03.2023 00:02

you did not add any references from the infrastructure or presentation layer. Those should reference the domain layer...?

Ответить
James Evans
James Evans - 04.03.2023 22:23

Hey Milan, Great video and congrats on the MVP, you have been smashing it and are awesome!

Ответить
Marina Sundström
Marina Sundström - 04.03.2023 12:56

Thanks for the video! It is important for beginners to know that once you get a hold of separating stuff you can adapt this structure to your case. Merge and rearrange. Even create your own modules and so. In my case I moved more towards a VSA and put controllers together with application code. As long as you clearly keep stuff logically separate it is OK.

Ответить
Jay Mark Estrera
Jay Mark Estrera - 04.03.2023 08:55

I'm really glad I found this channel. I was struggling to find these kind of videos before especially about DDD.

Ответить
Ammar Ahmed
Ammar Ahmed - 04.03.2023 07:47

hey milan!! I saw your serilog video and implement serilog in my project. its great.. but i need logs to print in seperate folders for each controller. can you please help me out or make another video about serilog with indepth configurations. thanks 👍

Ответить