How to Resolve Multiple Dependency Injection Implementations of the Same Interface in .NET
Вставка
- Опубліковано 8 тра 2024
- ►► Master Web API development Best Practices: bit.ly/3TnqoFQ
►► Build great web apps in Blazor WebAssembly: bit.ly/437g87T
►► Support us on Patreon and get the source code: / codemaze
I will talk about one interesting challenge we all faced in our .NET projects - resolving multiple implementations of the same interface with the dependency injection.
You will see that using the default dependency injection container offered by ASP.NET Core may reveal that the task, I will talk about, is more challenging than it initially appears.
Well, let’s see it with an example.
LINKS MENTIONED IN THE VIDEO
►► Factory Pattern with DI - • How to Use Factory Pat...
FOLLOW US ON SOCIAL MEDIA!
►► / marinko-spasojevic
►► / codemazeblog
►► / codemazeblog
Thank you all for watching and for your support.
►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM
►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
I have been looking for this for so long thanks! ❤
You're welcome! Thank you for watching the video.
@@CodeMaze Can I use your method but different example for my blog post?
Hi. Well yes. I didn't reinvent a wheel here, someone has probably already talked about this topic somewhere. Just use your words and your examples and you are good to go without plagiarism. After all, the original content is always the best one.
Best tutorial!
Thank you. Thanks for watching this one.
I have been using the resolver pattern, but the keyed services are pretty cool, saves you the stress of keeping track of those switch cases. Awesome content. Thanks
I completely agree. It is great that we have different options at disposal. Thank you for watching the video and your comment.