Click or drag to resize

AutofacAttributeExtensionsWithAttributeFilterTLimit, TReflectionActivatorData, TRegistrationStyle Method

Note: This API is now obsolete.

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

Namespace:  Autofac.Extras.AttributeMetadata
Assembly:  Autofac.Extras.AttributeMetadata (in Autofac.Extras.AttributeMetadata.dll) Version: 4.0.1-CI-226
Syntax
[ObsoleteAttribute("Use Autofac.Features.AttributeFilters.RegistrationExtensions.WithAttributeFiltering from the core Autofac library instead.")]
public static IRegistrationBuilder<TLimit, TReflectionActivatorData, TRegistrationStyle> WithAttributeFilter<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 WithMetadataAttribute in their constructors. Doing so will allow the attribute-based filtering to occur. See WithMetadataAttribute for an example on how to use the filter and attribute together.

See Also