AddDbContext<T> registers a DbContext type with ASP.NET Core dependency injection, connecting database access to the application’s request pipeline. section 5.4.1
Registration provides predictable request-scoped behavior:
- Creates one DbContext instance for each HTTP request. section 5.4.1
- Disposes the context when the response finishes. section 5.4.1
- Injects the same context into request-handling components such as CatalogController. section 5.4.1
Registering CatalogContext
Call builder.Services.AddDbContext<CatalogContext>() before AddControllers, then map controllers so injected CatalogContext instances are available to API actions.

