Glossary
The terms the documentation uses, in alphabetical order. Each entry links to the page that explains it in full.
Activation hook
A static method named with OnActivated that receives a service once it is constructed, before anyone gets it. A hook that returns Task or ValueTask makes the service async-initialized. See Lifecycle hooks.
Async initializer convention
An [AsyncInitializer<T>] on a container or module that names a method of T, such as IWarmUp.WarmUpAsync. Every service of that container or module whose implementation implements the interface or derives from the class T is initialized by awaiting the method once, before it is handed out. Your domain type keeps no reference to Awaiten. See Async initialization.
Async-initialized
A service that needs asynchronous setup before use: an async initializer convention or an asynchronous activation hook initializes it, or an async factory that returns Task<T> produces it. See Async initialization.
Async-tainted
A service that is async-initialized or depends on one through a dependency that is not deferred, such as a plain constructor parameter. Under strict async safety it is reachable only asynchronously. A deferred shape such as Task<T> or Func<Task<T>> keeps the consumer synchronous. See Keep a consumer synchronous by deferring the async work.
Async safety
The AsyncSafety option of a container. Strict, the default, makes an async-tainted service reachable only asynchronously. SyncAfterInit also lets it resolve synchronously, which blocks until it is initialized when it was not warmed up. See Relax the rule.
Base container
A container that another one names in [Container(Extends = …)]. The extending container starts from its whole composition. See Extending containers.
Captive dependency
A scoped service held by a singleton, directly or through transients, such as a scoped Order inside a singleton. It would outlive its scope, so Awaiten reports it at build time (AWT105). See Lifetimes must line up.
Closing
A closed form of an open generic registration, such as IRepository<Order> for [Transient(typeof(Repository<>), typeof(IRepository<>))]. Awaiten builds only the closings the graph asks for. See Open generics.
Collection
A dependency on every registration of a service, as IEnumerable<T>, IReadOnlyList<T>, an array or another supported shape. Awaiten builds it from the registrations at build time. See Collections.
Composite
An implementation that stands in for all others of a service: a plain dependency on the service gets the composite, and the composite receives the other registrations as a collection. Declared with [Composite]. See Composites.
Composition root
The one place in an application that composes the object graph. In Awaiten that is your [Container] and the Root you create at the entry point. Domain code does not reference the container. See Design principles.
Container
A static partial class marked [Container] that declares the registrations. The generator completes it with the Root and Scope types that do the work. See Getting started.
Contextual binding
A registration that applies only where it is injected into a given consumer, declared with WhenInjectedInto. Every other consumer gets the unconditional registration. See Keyed services.
Decorator
An implementation that wraps a service: it takes the service as a constructor parameter and is handed out in its place. Declared with [Decorate]. Several decorators chain. See Decorators.
Dispatch dictionary
A dictionary keyed by Type, such as IReadOnlyDictionary<Type, Func<IOrderHandler>>, that maps the type argument of each closing of a generic handler to a factory for that closing, for dispatch on a type only known at run time. See Dispatch by runtime type.
Eager singleton
A singleton marked Eager = true, built when the root is created instead of on first resolve. See Build a singleton at startup.
Extending container
A container that sets Extends to start from the composition of a base container, typically a test container that replaces a few services of the production one. See Extending containers.
External resolver
The IExternalResolver a container asks for its imported services. The MS.DI bridge wires one over the host's provider, and a standalone container passes its own to the Root constructor. See Providing the external resolver.
Generated handle
A public type a library module generates so that a container in another assembly can build, share and dispose a service registered under a type internal to the library. A handle is a dependency only and never resolved directly. See Shipping modules from a library.
Implementation
The concrete type the container constructs for a registration, such as CardTerminal in [Scoped<CardTerminal, IPaymentTerminal>]. Compare service type. See Lifetimes.
Imported service
A service the host provides rather than the container, declared with [ImportService] or [ImportServices]. The container resolves it through its external resolver and never disposes it. See External services.
Key
A value that tells several registrations of one service apart, set with Key on the registration and selected with [FromKey] or a keyed Resolve. A string, an enum value or a typeof(...). See Keyed services.
Keyed dictionary
A dependency such as IReadOnlyDictionary<string, IMilk> that maps each key to its keyed registration of a service. See Keyed dictionaries.
Lifetime
How long an instance lives and who shares it: a singleton once per container, a scoped service once per scope, a new transient for every resolve or injection. See Lifetimes.
Lifetime safety
The LifetimeSafety option of a container. Strict, the default, keeps disposable transients from piling up on the root: the root withholds them, and a root-owned Func over one is an error. Loose resolves everything everywhere, as Microsoft.Extensions.DependencyInjection does. See Lifetime safety.
Marker
The interface or base type a [Scan] matches against, such as IDrink in [Scan<IDrink>]. With ScanAs.Marker the matches also register under it. See Scanning.
Module
A static class marked [Module] that carries registrations for a container to [Import]. It is the Awaiten counterpart of an AddXyz() extension method on IServiceCollection. See Modules.
MS.DI bridge
The Awaiten.Extensions.DependencyInjection package, which runs a container under Microsoft.Extensions.DependencyInjection, such as in ASP.NET Core and the generic host. See MS.DI bridge.
Overridable default
A registration with Fallback = Fallback.Warn or Fallback.Silent, usually in a module. A registration of the same service without Fallback replaces it, unless that is a scan match or the closing of an open generic over a closed default. See Overridable defaults.
Owned<T>
A disposal handle: the service is built in a throwaway scope that disposing the handle disposes. The leak-free way to get a disposable service on demand. See Owned.
Projection
What the MS.DI bridge does with AddAwaitenContainer: it adds a service descriptor to the IServiceCollection for each service type and key of the container, the registration that wins single resolution, so the host resolves Awaiten services side by side with its own. Collections are not projected. See Project into a service collection.
Registration
An attribute such as [Singleton<Grinder>] that tells the container how to provide a service: which implementation, with which lifetime, and with which options. See Lifetimes and the attribute reference.
Relationship
A dependency shape that wraps a single service: Func<T> builds on demand, Lazy<T> builds once on first use, Task<T> awaits an async service, and Owned<T> hands over disposal. See Relationships.
Release hook
A static method named with OnRelease that receives a service when its owning container or scope is disposed, before the service's own disposal. See Lifecycle hooks.
Root
The generated Root type of a container, which you create with new. It is the container instance, the outermost scope and the owner of the singletons. See Scopes.
Scan
A [Scan] that registers every matching concrete class, read from the compilation at build time instead of listing each one. See Scanning.
Scope
A unit of work, such as one order or one web request, that caches its scoped services and disposes what it built. You open one from the root with CreateScope or CreateScopeAsync. See Scopes.
Service type
The type a registration is resolved as, such as IPaymentTerminal in [Scoped<CardTerminal, IPaymentTerminal>]. With one type argument, the implementation is its own service type. See Lifetimes.
Warm-up
Building and initializing async services ahead of time: InitializeAsync on the root for singletons, CreateScopeAsync for the scoped services of a new scope. See Warm everything up front.
Withheld service
A service the container has but the root declines to resolve by type, such as a disposable transient under strict lifetime safety. A child scope resolves it. Resolving it on the root throws an exception that names the fix, and GetResolvability reports it as WithheldOnRoot without throwing. See Feature detection.