Dependency Injection in Minimal APIs in C#

preview_player
Показать описание
Minimal APIs are an increasingly common way to create small API projects including microservices. But how do you handle dependency injection with a Minimal API? It turns out the answer to that is rather simple. In this video, I will show you how to use dependency inject, route parameters, and more in 10 minutes or less.

Рекомендации по теме
Комментарии
Автор

Thanks for the great video Tim!
It would be great if you could also reference your previous video links for things which are seen in this video, e.g. using Http files in VS, so that people which see those things for the first time can catch-up quickly.

albansejdiu
Автор

Hey Tim I really like your content and have learned a lot. I think you should consider giving a more “production” or “large-scale” scenario with videos. I often find the basics are usually straightforward but then seeing how it could be used in a large scale app could be useful as well

parkerwarner
Автор

As always clear and precise! The simple examples are the root for better understanding, thanks!

pavfrang
Автор

Excelente video, esa forma de enseñar tuya es muy fácil de entender. Llevo dos meses siguiéndote y vale mucho la pena tu información.

msxperiencemexico
Автор

Thanks for the great video. In MVC there's the [FromServices] attribute that we apply to function parameters for this sort of thing. I take it that idea didn't map over to Minimal APIs too well.

eawig
Автор

Great video, short and concise.
How would I go about registering my own services, e. g. for Data Access? Where would I put that inside of program.cs?

Alex-olbv
Автор

Looks very unusual. Interesting…Thanks for sharing!

torrvic
Автор

A little off topic, but when was the 'with' keyword implemented in c#? First time I have come across it!

BobbyBridgeman
Автор

Thank you for the short and great video :)

shahzadazzam
Автор

None of this is dependency injection? No service registration. No lifetimes. No container setup at all. This is just getting config values, and you didn’t even show object binding which would have been simpler than the “:” notation.

richardhauer
Автор

Great! But how this works under the hood? I mean passing values from DI-container to lamda parameters of mapping methods?

timur
Автор

Could you please make video on below question in DOT NET.I got this in an interview


Diffrence between Abstract Class and Concreate class
Difference between Finalize Method and Finalize block
Diffrent type of Garbage Collection method
how to handle Exception using Middleware in Dot Net core
Exposing Entity will create problem in Entity Framework How we handle it
How we validate Entity in Entity Framework
Two Interface have same method how we implement and call?
without using loop how we do bulk insert and update in sql server?
how map the data from model to database table if the column are diffrent?
how map data from list to model using linq query?
how join two table using linq?
how join two list using linq?
what happen if action parameter not matched with any method?
what is scope of a classs object?
how garbage collector know which objects needs to be deleted?
Entity framework -model mapping and how many type of model

gkmishra
Автор

What if you dont want to pass in a config inut parameter every single time your create an endpoint? Isn't it bad code to repeat the same thing again and again and again?

jacobhamfeldtkold
Автор

Is there any relevance in the real world for minimal api? I am a seasoned software developer and I haven’t seen this being used. I’m not bashing rather trying to understand the usefulness and adoption status of this technology

IamPali
Автор

what is an actual real world use case for this?

tinylittleanj
Автор

So stuff from the appsettings json is the only thing we can inject in this kind of APIs?

pxnchx
Автор

Need to calm that mouse down. Super distracting seeing the cursor draw circles all over the place.

dasfahrer