Загрузка...

Keyed Services in ASP.NET Core | Dependency Injection Explained with Examples in .NET 8

Are you struggling with multiple implementations in .NET Dependency Injection? In this video, I’ll explain Keyed Services, a new feature introduced in .NET 8 and C# 12 that allows you to register multiple service implementations with unique keys. This feature is especially useful in ASP.NET Core applications to resolve dependency conflicts. We'll start by demonstrating the common issue of overriding services in DI, then implement Email and SMS notification services to show how Keyed Services solve this problem. By the end of this tutorial, you'll understand how to use AddKeyedScoped, inject services with [FromKeyedServices], and write cleaner, more maintainable code in ASP.NET Core.

📚 Learn More:
➤ Dependency Injection in ASP.NET Core: Singleton vs Scoped vs Transient Explained: https://youtu.be/V-8HlozCTOU

➤ .NET 9 - Implementing Repository Pattern with Minimal API & SQLite | Entity Framework Core Tutorial: https://youtu.be/bOJLgzU4M74

➤ Build CRUD API with Dapper in .NET 9 | ASP.NET Core Web API Tutorial with SQL Server :https://youtu.be/_oFCFSiXsZw

Connect with me 👋:

► GITHUB: https://www.github.com/poorna-soysa
► LINKEDIN: https://www.linkedin.com/in/poorna-soysa/
► TWITTER: https://twitter.com/TechPoorna/

👉 Support my work:
https://www.buymeacoffee.com/poorna.soysa

Don't Forget to:
👍 Like this video if you found it helpful
🔔 Subscribe for more coding tutorials
💬 Comment if you have any questions or suggestions

#aspnetcore #dotnet #dotnet8 #csharp #dependencyinjection

Видео Keyed Services in ASP.NET Core | Dependency Injection Explained with Examples in .NET 8 канала Poorna Soysa
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять