Autofac .NET Inversion of Control Container
RegistrationExtensions Class
NamespacesAutofacRegistrationExtensions
Adds registration syntax to the ContainerBuilder type.
Declaration Syntax
C#Visual BasicVisual C++
public static class RegistrationExtensions
Public NotInheritable Class RegistrationExtensions
public ref class RegistrationExtensions abstract sealed
Members
All MembersMethods



IconMemberDescription
As<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, IEnumerable<(Of <(Service>)>)>)>))
Specifies how a type from a scanned assembly is mapped to a service.

As<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, Service>)>))
Specifies how a type from a scanned assembly is mapped to a service.

As<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, Type>)>))
Specifies how a type from a scanned assembly is mapped to a service.

AsClosedTypesOf<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Type)
Specifies that a type from a scanned assembly is registered if it implements an interface that closes the provided open generic interface type.

AsImplementedInterfaces<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>))
Specifies that a type from a scanned assembly is registered as providing all of its implemented interfaces.

AsSelf<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>))
Specifies that a type from a scanned assembly provides its own concrete type as a service.

AssignableTo<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Type)
Filters the scanned types to include only those assignable to the provided type.

AssignableTo<(Of <(T>)>)(IRegistrationBuilder<(Of <(Object, ScanningActivatorData, DynamicRegistrationStyle>)>))
Filters the scanned types to include only those assignable to the provided type.

Except<(Of <(T>)>)(IRegistrationBuilder<(Of <(Object, ScanningActivatorData, DynamicRegistrationStyle>)>))
Filters the scanned types to exclude the provided type.

FindConstructorsWith<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), BindingFlags)
Set the policy used to find candidate constructors on the implementation type.

FindConstructorsWith<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), IConstructorFinder)
Set the policy used to find candidate constructors on the implementation type.

InNamespace<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), String)
Filters the scanned types to include only those in the provided namespace or one of its sub-namespaces.

InNamespaceOf<(Of <(T>)>)(IRegistrationBuilder<(Of <(Object, ScanningActivatorData, DynamicRegistrationStyle>)>))
Filters the scanned types to include only those in the namespace of the provided type or one of its sub-namespaces.

Named<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, String>)>), Type)
Specifies how a type from a scanned assembly is mapped to a service.

OnRegistered<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>), Action<(Of <(ComponentRegisteredEventArgs>)>))
Provide a handler to be called when the component is registered.

OnRegistered<(Of <(TLimit, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, ScanningActivatorData, TRegistrationStyle>)>), Action<(Of <(ComponentRegisteredEventArgs>)>))
Provide a handler to be called when the component is registred.

PreserveExistingDefaults<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>))
Specifies that the component being registered should only be made the default for services that have not already been registered.

Register<(Of <(T>)>)(ContainerBuilder, Func<(Of <(IComponentContext, T>)>))
Register a delegate as a component.

Register<(Of <(T>)>)(ContainerBuilder, Func<(Of <(IComponentContext, IEnumerable<(Of <(Parameter>)>), T>)>))
Register a delegate as a component.

RegisterAssemblyTypes(ContainerBuilder, array<Assembly>[]()[])
Register the types in an assembly.

RegisterComponent(ContainerBuilder, IComponentRegistration)
Add a component to the container.

RegisterGeneric(ContainerBuilder, Type)
Register an un-parameterised generic type, e.g. Repository<>. Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>().

RegisterInstance<(Of <(T>)>)(ContainerBuilder, T)
Register an instance as a component.

RegisterModule(ContainerBuilder, IModule)
Add a module to the container.

RegisterModule<(Of <(TModule>)>)(ContainerBuilder)
Add a module to the container.

RegisterSource(ContainerBuilder, IRegistrationSource)
Add a registration source to the container.

RegisterType<(Of <(TImplementor>)>)(ContainerBuilder)
Register a component to be created through reflection.

RegisterType(ContainerBuilder, Type)
Register a component to be created through reflection.

Targeting<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TActivatorData, TSingleRegistrationStyle>)>), IComponentRegistration)
Sets the target of the registration (used for metadata generation.)

UsingConstructor<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), array<Type>[]()[])
Set the policy used to select from available constructors on the implementation type.

UsingConstructor<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), IConstructorSelector)
Set the policy used to select from available constructors on the implementation type.

Where<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, Boolean>)>))
Specifies a subset of types to register from a scanned assembly.

WithMetadata<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), Func<(Of <(Type, IEnumerable<(Of <(KeyValuePair<(Of <(String, Object>)>)>)>)>)>))
Specify how a type from a scanned assembly provides metadata.

WithMetadata<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TScanningActivatorData, TRegistrationStyle>)>), String, Func<(Of <(Type, Object>)>))
Specify how a type from a scanned assembly provides metadata.

WithParameter<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), String, Object)
Configure an explicit value for a constructor parameter.

WithParameter<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), Parameter)
Configure an explicit value for a constructor parameter.

WithParameters<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), IEnumerable<(Of <(Parameter>)>))
Configure explicit values for constructor parameters.

WithProperties<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), IEnumerable<(Of <(Parameter>)>))
Configure explicit values for properties.

WithProperty<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), String, Object)
Configure an explicit value for a property.

WithProperty<(Of <(TLimit, TReflectionActivatorData, TStyle>)>)(IRegistrationBuilder<(Of <(TLimit, TReflectionActivatorData, TStyle>)>), Parameter)
Configure an explicit value for a property.

Inheritance Hierarchy
Object
RegistrationExtensions

Assembly: Autofac (Module: Autofac) Version: 2.1.13.813 (2.1.13.813)