-
Notifications
You must be signed in to change notification settings - Fork 0
Dependency Injection
JessicaOPRD edited this page Feb 28, 2023
·
3 revisions
I have many notes and even a presentation about this. Some notes for comparison below:
- Reduces tight coupling
- Reduces need to establish new objects per use, if singleton behavior makes sense
- Often object instances to be passed in the constructor are referred to as "services."
- Added through the web application builder
// Framework services (built into core or an add-on)
builder.Services.AddControllerWithView();
// Custom services
builder.Services.AddScoped<ILoggerService, LoggerService>();
Testing what this does?