Click or drag to resize

IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyleInstancePerMatchingLifetimeScope Method

Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. Dependent components in lifetime scopes that are children of the tagged scope will share the parent's instance. If no appropriately tagged scope can be found in the hierarchy an DependencyResolutionException is thrown.

Namespace:  Autofac.Builder
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> InstancePerMatchingLifetimeScope(
	params Object[] lifetimeScopeTag
)

Parameters

lifetimeScopeTag
Type: SystemObject
Tag applied to matching lifetime scopes.

Return Value

Type: IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyle
A registration builder allowing further configuration of the component.
See Also