service registration

Telling the dependency injection container which implementation, with which lifetime, should satisfy requests for a service type.

In more detail

builder.Services.AddScoped<IOrderReader, OrderReader>() maps the abstraction on the left to the implementation on the right. Registrations happen at startup, before the host is built.

Related terms

Taught in

References