AutofacAttributeExtensionsWithAttributedMetadataTMetadata Method (IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle) |
This method can be invoked with the assembly scanner to register strongly typed metadata attributes. The
attributes are scanned for one that is derived from the metadata interface. If one is found, the metadata
contents are extracted and registered with the instance registration.
Namespace:
Autofac.Extras.AttributeMetadata
Assembly:
Autofac.Extras.AttributeMetadata (in Autofac.Extras.AttributeMetadata.dll) Version: 6.0.0+9ca59cfaf8ca9a019932258d79b859bcf16e8ed2
Syntax public static IRegistrationBuilder<Object, ScanningActivatorData, DynamicRegistrationStyle> WithAttributedMetadata<TMetadata>(
this IRegistrationBuilder<Object, ScanningActivatorData, DynamicRegistrationStyle> builder
)
<ExtensionAttribute>
Public Shared Function WithAttributedMetadata(Of TMetadata) (
builder As IRegistrationBuilder(Of Object, ScanningActivatorData, DynamicRegistrationStyle)
) As IRegistrationBuilder(Of Object, ScanningActivatorData, DynamicRegistrationStyle)
Parameters
- builder
- Type: Autofac.BuilderIRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle
The registration builder containing registration data.
Type Parameters
- TMetadata
- Metadata type to search for.
Return Value
Type:
IRegistrationBuilderObject,
ScanningActivatorData,
DynamicRegistrationStyleRegistration 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
IRegistrationBuilderObject,
ScanningActivatorData,
DynamicRegistrationStyle. 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 See Also