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.
@andyhb19702 ай бұрын
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 😂
@dawizze17 ай бұрын
Glad I stumbled on this through reddit. Great vid, and it looks like a great channel! Ty for sharing.
@jonowilliams267 ай бұрын
Thank you! Glad you enjoyed it
@victor18827 ай бұрын
Man I missed your videos, quality is top notch and the advice is even better, keep going!
@jonowilliams267 ай бұрын
Thanks Victor
@Sonicrockz187 ай бұрын
Fantastic video. Well explained and described and straight to the point. Thanks! Going to check out the rest of your vids.
@jonowilliams267 ай бұрын
Thank you! I appreciate the positive feedback. Glad you liked it!
I am trusting what is saying not to trust internet. Thanks for great video
@ChristianHowell7 ай бұрын
This is a great refactoring... I was using something different but this is more direct...
@jonowilliams267 ай бұрын
Glad you found it useful
@oliverarmitage19662 ай бұрын
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.
@tanakamawere7 ай бұрын
New Subscriber here. Nice stuff
@jonowilliams267 ай бұрын
Thank you!
@rafazieba99823 ай бұрын
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.
@vyteniskajackas75793 ай бұрын
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
@jt0995 ай бұрын
Just found your channel, great stuff!!
@v-bohrer7 ай бұрын
Amazing content, thanks! 🔥
@jonowilliams267 ай бұрын
Thank you!
@seesharp813217 ай бұрын
"Don't trust everything on the internet". That was the best part of the video 😜
@aliensoul7600Ай бұрын
Thank you dude 👍🏼
@jonowilliams26Ай бұрын
No problem 👍
@prabhu4d3 ай бұрын
Thanks bro
@jaymartinez3114 ай бұрын
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.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.
@jonowilliams266 ай бұрын
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
@rodilife6 ай бұрын
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.
@jonowilliams266 ай бұрын
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
@liva236muzika22 күн бұрын
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.
@zereflinob82707 ай бұрын
Tbh this sound like using controllers with extra steps and the need to DI into each method is annoying
@victor18827 ай бұрын
not as annoying as having controllers with giant constructors
@zereflinob82707 ай бұрын
@@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
@o0Qu7 ай бұрын
@@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
@victor18827 ай бұрын
@@o0Qu but then we could go all the way and have an endpoint that represents one use case with minimal APIs
@o0Qu7 ай бұрын
@@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