IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyleInstancePerOwnedTService Method (Object) |
Configure the component so that every dependent component or call to Resolve()
within a ILifetimeScope created by an owned instance gets the same, shared instance.
Dependent components in lifetime scopes that are children of the owned instance scope will
share the parent's instance. If no appropriate owned instance 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> InstancePerOwned<TService>(
params Object[] serviceKeys
)
Function InstancePerOwned(Of TService) (
ParamArray serviceKeys As Object()
) As IRegistrationBuilder(Of TLimit, TActivatorData, TRegistrationStyle)
Parameters
- serviceKeys
- Type: SystemObject
Keys to associate with the component.
Type Parameters
- TService
- The service type provided by the component.
Return Value
Type:
IRegistrationBuilderTLimit,
TActivatorData,
TRegistrationStyleA registration builder allowing further configuration of the component.
See Also