liveBook · Manning

IServiceCollection

As explained in Building Web APIs with ASP.NET Core

A service collection is a registry of application services and their dependency-injection configurations.

IServiceCollection is the application’s registry for services and their dependency-injection configurations. In a gRPC setup, Program.cs uses it to register the framework services needed by the server. section 10.3.4

Registering gRPC services

Add the gRPC services to the collection before connecting the application to the HTTP pipeline: `builder.Services.AddGrpc();`. The related application configuration then maps the implemented `GrpcService` with `app.MapGrpcService<GrpcService>();`. section 10.3.4

builder.Services.AddGrpc();

Use the concise registration listing to verify the service-collection call in Program.cs. section 10.3.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Shows one registration call but does not descend into the collection’s internals or dependency-injection resolution process.
Examples
Uses builder.Services.AddGrpc() alongside app.MapGrpcService<GrpcService>() in the application startup configuration.
What you can do after
Operate/configure a gRPC server by registering its framework services in the application startup pipeline.
How it connects
Connects dependency injection with gRPC services, Program.cs, the HTTP pipeline, and EF Core-backed service implementation.

Also explained in

Compare how 2 books explain IServiceCollection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.