mid55 zgłoszeń
Czym jest Dependency Injection w ASP.NET Core?
ASP.NET Core ma wbudowany DI container. Rejestracja w Program.cs: AddTransient (nowa instancja), AddScoped (per-request), AddSingleton (jedna). Wstrzykiwanie przez konstruktor. IServiceCollection konfiguruje, IServiceProvider rozwiązuje. Wspiera interfejsy i konkretne typy.