.NET 7 minimal API from scratch | FULL COURSE | clean architecture, repository pattern, CQRS MediatR

preview_player
Показать описание
Join this channel to get source code access and other perks:

In this course I want to provide you a project structure and code organization to get you started with real .NET 7 minimal API projects. It's a full course on this topic where I start from creating and explaining the project structure, setting up different layers using EF Core, repository pattern, CQRS and MediatR. The biggest part of the video is however around the .NET 7 minimal API, taking you from the initial setup, explaining route handlers, implementing all CRUD operations and so on. Last but not least, this course walks you through the process of refactoring the .NET 7 minimal API so that it becomes readable, maintainable and scalable. At the end, you'll have a full project structure organized according to modern architectural patterns that you can take as a template for your own projects.
#dotnet #dotnetcore #aspnetcore

Contents
1. Intro: 00:00
2. Structuring the solution: 01:00
3. Coding the domain layer: 05:25
4. Coding the data access layer: 08:22
5. Creating repositories: 11:17
6. Adding migrations and database update: 22:30
7. CQRS with MediatR: 29:07
8. Route and rout handlers: 52:06
9. Dependency injection: 55:52
10. Implementing GET by ID : 57:40
11. Implementing POST route: 01:00:26
12. Implementing GET all route: 01:03:41
13. Implement PUT and DELETE: 01:04:57
14. Testing with Postman: 01:09:01
15. Is there a problem? 01:12:41
16. Refactoring service registrations: 01:15:49
17. Refactoring route registrations: 01:20:01
18. Automatic registration of endpoints: 01:26:28
19. Introducing route groups: 01:31:43
20. Extract lambdas into instance methods: 01:34:31
21: Model validation with endpoint filters: 01:45:58
22. Global exception handling: 01:55:10
23. Conclusions: 01:59:49
Рекомендации по теме
Комментарии
Автор

Thank You very much. Keep sharing. Trying to get a better understanding on Clean Architecture..

michaelshepherdmunemo
Автор

This is fantastic. I like this sort of explanation a lot especially coming from golang and python

ragequilt_
Автор

Thanks for your fantastic work! As always in depth topic explanation, great for education, opposite to some other C# content creators.

obi-wan-kenbi
Автор

What a fantastic guide - thank you so much!!

EverybodyWasTofuFighting
Автор

Thanks, this tutorial was covered really all about a minimal API project.

mahsanghasemi
Автор

Impecable timing as usual . Thanks for this

teriyakov
Автор

Thanks for the GOLD Worthy Course, Great Job 🎉🎉🎉🎉🎉

athourrahman
Автор

What are the practical benefits of having separate DataAccess, Domain, and Application projects? Why not just organise with folders/namespaces and classes inside the api project?

patsy
Автор

Thank you so much !! can't thank you enough !!

saadablat
Автор

Thank you for the excellent video.
In the validation post filter, in order not to rely on the order of the minimal API method parameters, I added the following method:

private static int arguments, Type argumentType)
{
if (arguments == null) throw new cannot be null.");

var argumentIndex = 0;

foreach (var argument in arguments)
{
if (argument != null && argument.GetType() == argumentType) return argumentIndex;
argumentIndex++;
}

throw new Exception($"Index not found for argument type '{nameof(argumentType)}'.");
}

And, on the filter "InvokeAsync", instead of:

var post = context.GetArgument<Post>(1);

I wrote:

var argumentIndex = GetArgumentIndex(context.Arguments, typeof(Post));
var post =

This way I don't have to worry about the order of parameters in the methods.
Do you think this is a valid alternative to what is suggested in the video?
Thank you.

blasferatu
Автор

Great work! I followed your video and all ok, but when I added more services I had an problem with DBContext in one of the Handler. I have updated with breaking changes of MediatR but still no worked.

rubenguinez
Автор

I hope you will have more supporters. Your contents are amazing.

vinland-hw
Автор

what are the benefits to using a route filter? i would rather just validate at the start of my method... i wont have to worry about trying to figure out argument index too

path_selector
Автор

It is very very very help full thanks a lot

salimanahmad
Автор

Thanks Dan, do you perhaps have this repo available in Github somewhere to clone?

leonmeintjes
Автор

I have a question. How this is different from controllers? Replace EndpointDefinition with Controller and it looks the same to me. You can even make a Constructor and inject Mediator. Is it better then Controllers?

obi-wan-kenbi
Автор

Thanks a lot for this GREAT content! :D

mirandamon
Автор

What blank solution did you use to start, it's not clear at all? Thanks!

Duelweb
Автор

Thanks a lot for such a nice tutorial, Subscribed the Channel :-)

Siblings
Автор

Do you have this kind tutorial but will use stored procedure..

kiddonouka