Click or drag to resize

ComponentRegistrarSetInjectPropertiesTReflectionActivatorData, TSingleRegistrationStyle Method

Sets the property injection mode for the component.

Namespace:  Autofac.Configuration.Core
Assembly:  Autofac.Configuration (in Autofac.Configuration.dll) Version: 6.0.0+ec1c6438ceb3f3338c7364e35e7303f014e3fc39
Syntax
protected virtual void SetInjectProperties<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 injectProperties content will be read from this configuration object and used to determine property injection status.
registrar
Type: Autofac.BuilderIRegistrationBuilderObject, TReflectionActivatorData, TSingleRegistrationStyle
The component registration on which the property injection 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 injectProperties is not part of the recognized grammar.
Remarks

By default, this implementation understands , empty, or values (false, 0, no) to mean "no property injection" and values (true, 1, yes) to mean property injection should occur.

You may override this method to extend the available grammar for property injection settings.

See Also