Skip to content

Compono.CompositionBuilder.UseServiceProvider(System.IServiceProvider)

Compono

Compono.CompositionBuilder

CompositionBuilder.UseServiceProvider(IServiceProvider) Method

Configures a native System.IServiceProvider as stage 3's fallback for a type with no exact Register<T>(Func<ICompositionContext,T>) entry - tried only after every exact registration misses, before falling through to stage 4. See docs/adr/0019-registrations-and-service-provider-injection.md for the full ordering and null/exception/wrong-type semantics.

public Compono.CompositionBuilder UseServiceProvider(System.IServiceProvider provider);

Parameters

provider System.IServiceProvider

The externally-owned container to fall back to.

Returns

CompositionBuilder

Remarks

Compono never creates, resolves, or disposes a scope from provider - it calls GetService(Type) directly and nothing else. Calling this more than once is a build-time conflict, following the same scalar-fail-fast rule as WithSeed(int).