Skip to content

Concepts

The container has a small model. These pages describe each part of it, and only the parts that exist in the implementation.

Page What it covers
Registration ServiceCollection, the add_* methods, registration by interface / instance / factory, the composition root
Resolution resolve / resolve_async, construction order, how annotations are read
Lifetimes and scopes singleton, transient, scoped; create_scope; the ambient scope contextvar
Factories factory=, what a factory receives, when it runs
Async resolve_async, async factories, async scope exit
Disposal what gets disposed, when, and what does not
The dependency graph build-time validation, cycle detection, lifetime rules
Errors the exception hierarchy and what raises each error

If you have read Getting started you have already seen registration, resolution, and lifetimes in use. These pages fill in the edges.