2min chapter

The Unhandled Exception Podcast cover image

Dependency Injection in .NET with Steve Collins

The Unhandled Exception Podcast

CHAPTER

Dotnet Container

The dotnet container works on the basis of a lasting winds principle. So if your consuming class says, i want one instance of interface a, then whatever the last one you've registered will be the one that gets served up. If thay are innumerable, you'll get them in the order that they were registered with the container. You can do a link query and say, order by whatever you want to order it by to get them into the right order. I wouldn't necessarily advocate is testing what the concrete implementation name is, because that may be a never shifting sands underneath you. But by doing that, i innumerable, you get all the different implementations, and then it's up to

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode