Click or drag to resize

ComponentRegistrarSetAutoActivateTReflectionActivatorData, TSingleRegistrationStyle Method

Sets the auto activation mode for the component.

Namespace:  Autofac.Configuration.Core
Assembly:  Autofac.Configuration (in Autofac.Configuration.dll) Version: 6.0.0+ec1c6438ceb3f3338c7364e35e7303f014e3fc39
Syntax
protected virtual void SetAutoActivate<TReflectionActivatorData, TSingleRegistrationStyle>(
	IConfiguration component,
	IRegistrationBuilder<Object, TReflectionActivatorData, TSingleRegistrationStyle> registrar
)
where TReflectionActivatorData : ReflectionActivatorData
where TSingleRegistrationStyle : SingleRegistrationStyle

Parameters

component
Type: IConfiguration
The configuration data containing the component. The autoActivate content will be read from this configuration object and used to determine auto activation status.
registrar
Type: Autofac.BuilderIRegistrationBuilderObject, TReflectionActivatorData, TSingleRegistrationStyle
The component registration on which auto activation mode is being set.

Type Parameters

TReflectionActivatorData
Activator data type.
TSingleRegistrationStyle
Registration style.
Exceptions
ExceptionCondition
ArgumentNullException Thrown if registrar or component is .
InvalidOperationException Thrown if the value for autoActivate is not part of the recognized grammar.
Remarks

By default, this implementation understands , empty, or values (false, 0, no) to mean "not auto-activated" and values (true, 1, yes) to mean auto activation should occur.

You may override this method to extend the available grammar for auto activation settings.

See Also