Advanced ASP.NET Core Dependency Injection: Scoped, Conditional, Generic Services

preview_player
Показать описание
Welcome to our deep dive into advanced Dependency Injection (DI) scenarios in ASP.NET Core! 🚀

In this video, we'll explore three powerful DI techniques that will elevate your development skills:
1. Scoped Services in Singleton Services: Learn how to use scoped services within singleton services effectively.
2. Conditional Service Implementations: Discover how to implement different services based on specific conditions.
3. Generic Services and DI: Understand the flexibility of generic services and how to register them efficiently.

Dependency Injection is a fundamental part of ASP.NET Core, but mastering these advanced features can significantly improve your application's performance and maintainability.

Highlights:
00:00 Introduction
01:42 Utilizing Scoped Services in Singleton
02:27 Example: Scoped dbContext in Singleton Reporting Service
05:40 Conditional Service Implementations
06:28 Example: EmailSender Mock for Development Environment
08:47 Generic Services and DI
09:39 Example: Generic Repository Pattern

If you find this video helpful, don't forget to like, share, and subscribe for more programming tutorials and tips!

Thank you for watching, and happy coding! 😊
Рекомендации по теме
Комментарии
Автор

You should make the font size Anyhow great content...❤

allwinantofranklin
Автор

Thanks for the video! Just a quick note on the conditional implementation part:
The Service Container becomes read-only after the web application is built with builder.Build().
To conditionally add services, you need to register them before the Build() statement. For example:
if
{
// Register development services here
}
else
{
// Register production services here
}

billxenakis
Автор

thanks for the video, could you be less verbose at the begining?

MikeRdz
join shbcf.ru