Click or drag to resize

RegistrationExtensionsWithAttributeFilteringTLimit, TReflectionActivatorData, TRegistrationStyle Method

Applies attribute-based filtering on constructor dependencies for use with attributes derived from the ParameterFilterAttribute.

Namespace:  Autofac.Features.AttributeFilters
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
public static IRegistrationBuilder<TLimit, TReflectionActivatorData, TRegistrationStyle> WithAttributeFiltering<TLimit, TReflectionActivatorData, TRegistrationStyle>(
	this IRegistrationBuilder<TLimit, TReflectionActivatorData, TRegistrationStyle> builder
)
where TReflectionActivatorData : ReflectionActivatorData

Parameters

builder
Type: Autofac.BuilderIRegistrationBuilderTLimit, TReflectionActivatorData, TRegistrationStyle
The registration builder containing registration data.

Type Parameters

TLimit
The type of the registration limit.
TReflectionActivatorData
Activator data type.
TRegistrationStyle
Registration style type.

Return Value

Type: IRegistrationBuilderTLimit, TReflectionActivatorData, TRegistrationStyle
Registration builder allowing the registration to be configured.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRegistrationBuilderTLimit, TReflectionActivatorData, TRegistrationStyle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullException Thrown if builder is .
Remarks

Apply this extension to component registrations that use attributes that derive from the ParameterFilterAttribute like the MetadataFilterAttribute in their constructors. Doing so will allow the attribute-based filtering to occur. See MetadataFilterAttribute for an example on how to use the filter and attribute together.

See Also