STOP using Minimal APIs for Large Projects!

  Рет қаралды 10,306

Jono Williams

Jono Williams

Күн бұрын

Пікірлер: 43
@hemuutube
@hemuutube 2 ай бұрын
First of all nice video! One point we are missing here is not all endpoints use same dependencies. If only some endpoints are using heavy objects then rest of the endpoints performance degrade if we are using controllers. We can avoid that using minimal api.
@andyhb1970
@andyhb1970 2 ай бұрын
Never had a problem with minimal API setup or structure, ive got mine all nicely separated out by feature group and cannot see any reason to return to controllers. If you mess up your minimal APIs then the chances are you'll mess up your controllers 😂
@dawizze1
@dawizze1 7 ай бұрын
Glad I stumbled on this through reddit. Great vid, and it looks like a great channel! Ty for sharing.
@jonowilliams26
@jonowilliams26 7 ай бұрын
Thank you! Glad you enjoyed it
@victor1882
@victor1882 7 ай бұрын
Man I missed your videos, quality is top notch and the advice is even better, keep going!
@jonowilliams26
@jonowilliams26 7 ай бұрын
Thanks Victor
@Sonicrockz18
@Sonicrockz18 7 ай бұрын
Fantastic video. Well explained and described and straight to the point. Thanks! Going to check out the rest of your vids.
@jonowilliams26
@jonowilliams26 7 ай бұрын
Thank you! I appreciate the positive feedback. Glad you liked it!
@DamianPEdwards
@DamianPEdwards 7 ай бұрын
Great video mate. Subscribed!
@jonowilliams26
@jonowilliams26 7 ай бұрын
Glad you liked it. Thanks for the sub!
@ml_serenity
@ml_serenity 2 ай бұрын
Confidently incorrect redditor. Nice explanation. +sub
@jonowilliams26
@jonowilliams26 2 ай бұрын
Thanks for the sub!
@okcharles7
@okcharles7 7 ай бұрын
I am trusting what is saying not to trust internet. Thanks for great video
@ChristianHowell
@ChristianHowell 7 ай бұрын
This is a great refactoring... I was using something different but this is more direct...
@jonowilliams26
@jonowilliams26 7 ай бұрын
Glad you found it useful
@oliverarmitage1966
@oliverarmitage1966 2 ай бұрын
Great video, Came across this reddit thread and some of the misinformation in the replies got my piss boiling more than it should have tbh - I do primarily blame Microsoft though for coming up with yet another vague name for a product.
@tanakamawere
@tanakamawere 7 ай бұрын
New Subscriber here. Nice stuff
@jonowilliams26
@jonowilliams26 7 ай бұрын
Thank you!
@rafazieba9982
@rafazieba9982 3 ай бұрын
You can easily merge those attributes on a controller and on controller's actions to a single line on each to get a similar number of lines of code. Should you? No. The only "good reason" to switch to minimal API is performance if you are injecting a lot of unnecessary, transient and expensive to instantiate services to controllers because you structured them badly. The rest is just a matter of preference. There is nothing inherently better about the minimal API over the controllers approach.
@vyteniskajackas7579
@vyteniskajackas7579 3 ай бұрын
Minimal APIs are less "magic", a similar way is used in most other languages, they aren't bloated by default. I think there are a fair share of advantages. Better question is, what controllers have over minimal APIs
@jt099
@jt099 5 ай бұрын
Just found your channel, great stuff!!
@v-bohrer
@v-bohrer 7 ай бұрын
Amazing content, thanks! 🔥
@jonowilliams26
@jonowilliams26 7 ай бұрын
Thank you!
@seesharp81321
@seesharp81321 7 ай бұрын
"Don't trust everything on the internet". That was the best part of the video 😜
@aliensoul7600
@aliensoul7600 Ай бұрын
Thank you dude 👍🏼
@jonowilliams26
@jonowilliams26 Ай бұрын
No problem 👍
@prabhu4d
@prabhu4d 3 ай бұрын
Thanks bro
@jaymartinez311
@jaymartinez311 4 ай бұрын
If it’s not minimal api then i don’t even want to use dotnet 😂. It’s the only thing i use in dotnet period.
@pyce.
@pyce. 6 ай бұрын
I really don't think that 12 lines is worth it. How are you not bothered that the route definitions and documentations moved so far away from the actual implementations.
@jonowilliams26
@jonowilliams26 6 ай бұрын
Moved so far away? They are in the same file. If you are that bothered by that you can always create an inline lambda function as your implementation, so your route, documentation and implementation are grouped together
@rodilife
@rodilife 6 ай бұрын
Great video. Controllers just work. Minimal APIs require a whole setup and organizational flow. Minimal does not have that much less code? Keep in mind he deleted the comments in the minimal version but not in the controller version, which is weird. I’ll just use controllers, only refactored to minimal APIs if I ever need that extra performance. Most of us never do.
@jonowilliams26
@jonowilliams26 6 ай бұрын
The comments in the controller version were required for the swagger documentation. Minimal APIs use methods like WithSummary() to add swagger docs rather than XML comments. Thats why they were removed
@liva236muzika
@liva236muzika 22 күн бұрын
I am currently on a controllers vs minimal apis quest. Really want to like Minimal Apis, but registering endpoints and groups seems lacking. I mean the methods are there, it's not rocket science, but I don't like the hoops you have to go jumo through to make it work elegantly. I wish MS would just port all the attributes over for Minimal APIs, then it would be great.
@zereflinob8270
@zereflinob8270 7 ай бұрын
Tbh this sound like using controllers with extra steps and the need to DI into each method is annoying
@victor1882
@victor1882 7 ай бұрын
not as annoying as having controllers with giant constructors
@zereflinob8270
@zereflinob8270 7 ай бұрын
@@victor1882 if you are injecting that many services into your controller you have a problem and also if you have a giant constrcutor you will equally have a giant method
@o0Qu
@o0Qu 7 ай бұрын
@@victor1882 you dont have controllers with giant constructors, you have a controller that should have 1 businesslayer and that businesslayer shall act as a higher orchestration layer
@victor1882
@victor1882 7 ай бұрын
@@o0Qu but then we could go all the way and have an endpoint that represents one use case with minimal APIs
@o0Qu
@o0Qu 7 ай бұрын
@@victor1882 i dont know enough about minimal API to spare with you on that subject, I've only gave a solution to your statement about huge ctors in controllers , I assume that if you have huge ctors controllers your controllers are fat and not thin, then your controllers are probably doing more than it should according to SOC principle
Request Validation in .NET / C# Minimal APIs
7:51
Jono Williams
Рет қаралды 5 М.
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 45 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 58 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,4 МЛН
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 13 МЛН
ASP.NET Core Web API .NET 8 2024 - 2. Models
13:58
Teddy Smith
Рет қаралды 86 М.
The Right Way To Return API Errors in .NET
10:40
Nick Chapsas
Рет қаралды 58 М.
Best 10 Items I Tested in 2024!
20:12
Project Farm
Рет қаралды 135 М.
Angular 19 New Exciting Features! #angular #coding #software
6:01
Michael Olech Coding
Рет қаралды 461
How to structure your .NET / C# API's
8:35
Jono Williams
Рет қаралды 11 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 258 М.
What’s the Result Type Everyone Is Using in .NET?
14:47
Nick Chapsas
Рет қаралды 113 М.