How to Resolve Multiple Dependency Injection Implementations of the Same Interface in .NET

  Рет қаралды 1,827

Code Maze

Code Maze

Күн бұрын

►► 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

Пікірлер: 9
@CodeMaze
@CodeMaze 4 ай бұрын
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
@changuanyu874
@changuanyu874 4 ай бұрын
I have been looking for this for so long thanks! ❤
@CodeMaze
@CodeMaze 4 ай бұрын
You're welcome! Thank you for watching the video.
@changuanyu874
@changuanyu874 4 ай бұрын
@@CodeMaze Can I use your method but different example for my blog post?
@CodeMaze
@CodeMaze 4 ай бұрын
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.
@ugochukwuumerie6378
@ugochukwuumerie6378 4 ай бұрын
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
@CodeMaze
@CodeMaze 4 ай бұрын
I completely agree. It is great that we have different options at disposal. Thank you for watching the video and your comment.
@10Totti
@10Totti 4 ай бұрын
Best tutorial!
@CodeMaze
@CodeMaze 4 ай бұрын
Thank you. Thanks for watching this one.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 61 М.
МЕБЕЛЬ ВЫДАСТ СОТРУДНИКАМ ПОЛИЦИИ ТАБЕЛЬНУЮ МЕБЕЛЬ
00:20
Cute
00:16
Oyuncak Avı
Рет қаралды 11 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 1,3 МЛН
CRUD with the Blazor WebAssembly Render Mode in .NET 8 🔥
50:49
Implementing API Gateway With Ocelot in ASP.NET Core
13:26
Code Maze
Рет қаралды 3 М.
Result Pattern Implementation in ASP NET Core Web API
13:28
Code Maze
Рет қаралды 3,7 М.
"I Hate Agile!" | Allen Holub On Why He Thinks Agile And Scrum Are Broken
8:33
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 158 М.
Senior Angular Developer Interview (theory)
41:57
WeCoded
Рет қаралды 20 М.
.NET and C# are in trouble. Here is what I'd do.
10:57
Ed Andersen
Рет қаралды 65 М.
МЕБЕЛЬ ВЫДАСТ СОТРУДНИКАМ ПОЛИЦИИ ТАБЕЛЬНУЮ МЕБЕЛЬ
00:20