Click or drag to resize

RegistrationExtensions Class

Adds registration syntax to the ContainerBuilder type.
Inheritance Hierarchy
SystemObject
  AutofacRegistrationExtensions

Namespace:  Autofac
Assembly:  Autofac (in Autofac.dll) Version: 4.9.1+831973f4d02fbc619921dfaa8ac0c536f60ae7a3
Syntax
public static class RegistrationExtensions

The RegistrationExtensions type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAsTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, Service)
Specifies how a type from a scanned assembly is mapped to a service.
Public methodStatic memberAsTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, IEnumerableService)
Specifies how a type from a scanned assembly is mapped to a service.
Public methodStatic memberAsTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, IEnumerableType)
Specifies how a type from a scanned assembly is mapped to a service.
Public methodStatic memberAsTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, Type)
Specifies how a type from a scanned assembly is mapped to a service.
Public methodStatic memberAsClosedTypesOfTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, 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.
Public methodStatic memberAsClosedTypesOfTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, Type, FuncType, Object)
Specifies that a type from a scanned assembly is registered if it implements an interface that closes the provided open generic interface type.
Public methodStatic memberAsClosedTypesOfTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, Type, Object)
Specifies that a type from a scanned assembly is registered if it implements an interface that closes the provided open generic interface type.
Public methodStatic memberAsImplementedInterfacesTLimit(IRegistrationBuilderTLimit, ReflectionActivatorData, DynamicRegistrationStyle)
Specifies that a type is registered as providing all of its implemented interfaces.
Public methodStatic memberAsImplementedInterfacesTLimit(IRegistrationBuilderTLimit, ScanningActivatorData, DynamicRegistrationStyle)
Specifies that a type from a scanned assembly is registered as providing all of its implemented interfaces.
Public methodStatic memberAsImplementedInterfacesTLimit, TConcreteActivatorData(IRegistrationBuilderTLimit, TConcreteActivatorData, SingleRegistrationStyle)
Specifies that a type is registered as providing all of its implemented interfaces.
Public methodStatic memberAsSelfTLimit(IRegistrationBuilderTLimit, ReflectionActivatorData, DynamicRegistrationStyle)
Specifies that a type provides its own concrete type as a service.
Public methodStatic memberAsSelfTLimit(IRegistrationBuilderTLimit, ScanningActivatorData, DynamicRegistrationStyle)
Specifies that a type from a scanned assembly provides its own concrete type as a service.
Public methodStatic memberAsSelfTLimit, TConcreteActivatorData(IRegistrationBuilderTLimit, TConcreteActivatorData, SingleRegistrationStyle)
Specifies that a type provides its own concrete type as a service.
Public methodStatic memberAssignableToT(IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle)
Filters the scanned types to include only those assignable to the provided type.
Public methodStatic memberAssignableToTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, Type)
Filters the scanned types to include only those assignable to the provided type.
Public methodStatic memberAutoActivateTLimit, TActivatorData, TRegistrationStyle
Wraps a registration in an implicit IStartable and automatically activates the registration after the container is built.
Public methodStatic memberExceptT(IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle)
Filters the scanned types to exclude the provided type.
Public methodStatic memberExceptT(IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle, ActionIRegistrationBuilderT, ConcreteReflectionActivatorData, SingleRegistrationStyle)
Filters the scanned types to exclude the provided type, providing specific configuration for the excluded type.
Public methodStatic memberFindConstructorsWithTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, IConstructorFinder)
Set the policy used to find candidate constructors on the implementation type.
Public methodStatic memberFindConstructorsWithTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, FuncType, ConstructorInfo)
Set the policy used to find candidate constructors on the implementation type.
Public methodStatic memberIfNotRegisteredTLimit, TActivatorData, TStyle
Attaches a predicate such that a registration will only be made if a specific service type is not already registered. The predicate will run at registration time, not runtime, to determine whether the registration should execute.
Public methodStatic memberInNamespaceTLimit, TScanningActivatorData, TRegistrationStyle
Filters the scanned types to include only those in the provided namespace or one of its sub-namespaces.
Public methodStatic memberInNamespaceOfT
Filters the scanned types to include only those in the namespace of the provided type or one of its sub-namespaces.
Public methodStatic memberInstancePerRequestTLimit, TActivatorData, TStyle
Share one instance of the component within the context of a single web/HTTP/API request. Only available for integration that supports per-request dependencies (e.g., MVC, Web API, web forms, etc.).
Public methodStatic memberKeyedTService(IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle, FuncType, Object)
Specifies how a type from a scanned assembly is mapped to a keyed service.
Public methodStatic memberKeyedTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, Object, Type)
Specifies how a type from a scanned assembly is mapped to a keyed service.
Public methodStatic memberNamedTService(IRegistrationBuilderObject, ScanningActivatorData, DynamicRegistrationStyle, FuncType, String)
Specifies how a type from a scanned assembly is mapped to a named service.
Public methodStatic memberNamedTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, String, Type)
Specifies how a type from a scanned assembly is mapped to a named service.
Public methodStatic memberOnlyIfTLimit, TActivatorData, TStyle
Attaches a predicate to evaluate prior to executing the registration. The predicate will run at registration time, not runtime, to determine whether the registration should execute.
Public methodStatic memberOnRegisteredTLimit, TRegistrationStyle(IRegistrationBuilderTLimit, ScanningActivatorData, TRegistrationStyle, ActionComponentRegisteredEventArgs)
Provide a handler to be called when the component is registred.
Public methodStatic memberOnRegisteredTLimit, TActivatorData, TSingleRegistrationStyle(IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle, ActionComponentRegisteredEventArgs)
Provide a handler to be called when the component is registered.
Public methodStatic memberOnReleaseTLimit, TActivatorData, TRegistrationStyle
Run a supplied action instead of disposing instances when they're no longer required.
Public methodStatic memberPreserveExistingDefaultsTLimit, TRegistrationStyle(IRegistrationBuilderTLimit, ScanningActivatorData, TRegistrationStyle)
Specifies that the components being registered should only be made the default for services that have not already been registered.
Public methodStatic memberPreserveExistingDefaultsTLimit, TActivatorData, TSingleRegistrationStyle(IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle)
Specifies that the component being registered should only be made the default for services that have not already been registered.
Public methodStatic memberPropertiesAutowiredTLimit, TActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyle, PropertyWiringOptions)
Configure the component so that any properties whose types are registered in the container will be wired to instances of the appropriate service.
Public methodStatic memberPropertiesAutowiredTLimit, TActivatorData, TStyle(IRegistrationBuilderTLimit, TActivatorData, TStyle, FuncPropertyInfo, Object, Boolean)
Set the policy used to find candidate properties on the implementation type.
Public methodStatic memberRegisterT(ContainerBuilder, FuncIComponentContext, T)
Register a delegate as a component.
Public methodStatic memberRegisterT(ContainerBuilder, FuncIComponentContext, IEnumerableParameter, T)
Register a delegate as a component.
Public methodStatic memberRegisterAdapterTFrom, TTo(ContainerBuilder, FuncTFrom, TTo)
Adapt all components implementing service TFrom to provide TTo using the provided adapter function.
Public methodStatic memberRegisterAdapterTFrom, TTo(ContainerBuilder, FuncIComponentContext, TFrom, TTo)
Adapt all components implementing service TFrom to provide TTo using the provided adapter function.
Public methodStatic memberRegisterAdapterTFrom, TTo(ContainerBuilder, FuncIComponentContext, IEnumerableParameter, TFrom, TTo)
Adapt all components implementing service TFrom to provide TTo using the provided adapter function.
Public methodStatic memberRegisterAssemblyTypes
Register all types in an assembly.
Public methodStatic memberRegisterComponent
Add a component to the container.
Public methodStatic memberRegisterDecorator(ContainerBuilder, Type, Type, FuncIDecoratorContext, Boolean)
Decorate all components implementing service serviceType with decorator service decoratorType.
Public methodStatic memberRegisterDecoratorTService(ContainerBuilder, FuncIComponentContext, IEnumerableParameter, TService, TService, FuncIDecoratorContext, Boolean)
Decorate all components implementing service TService using the provided decorator function.
Public methodStatic memberRegisterDecoratorTService(ContainerBuilder, FuncTService, TService, Object, Object)
Decorate all components implementing service TService using the provided decorator function. The fromKey and toKey parameters must be different values.
Public methodStatic memberRegisterDecoratorTService(ContainerBuilder, FuncIComponentContext, TService, TService, Object, Object)
Decorate all components implementing service TService using the provided decorator function. The fromKey and toKey parameters must be different values.
Public methodStatic memberRegisterDecoratorTService(ContainerBuilder, FuncIComponentContext, IEnumerableParameter, TService, TService, Object, Object)
Decorate all components implementing service TService using the provided decorator function. The fromKey and toKey parameters must be different values.
Public methodStatic memberRegisterDecoratorTDecorator, TService(ContainerBuilder, FuncIDecoratorContext, Boolean)
Decorate all components implementing service TService with decorator service TDecorator.
Public methodStatic memberRegisterGeneric
Register an un-parameterised generic type, e.g. Repository<>. Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>().
Public methodStatic memberRegisterGenericDecorator(ContainerBuilder, Type, Type, FuncIDecoratorContext, Boolean)
Decorate all components implementing open generic service serviceType.
Public methodStatic memberRegisterGenericDecorator(ContainerBuilder, Type, Type, Object, Object)
Decorate all components implementing open generic service decoratedServiceType. The fromKey and toKey parameters must be different values.
Public methodStatic memberRegisterInstanceT
Register an instance as a component.
Public methodStatic memberRegisterSource
Add a registration source to the container.
Public methodStatic memberRegisterType(ContainerBuilder, Type)
Register a component to be created through reflection.
Public methodStatic memberRegisterTypeTImplementer(ContainerBuilder)
Register a component to be created through reflection.
Public methodStatic memberRegisterTypes
Register the types in a list.
Public methodStatic memberTargetingTLimit, TActivatorData, TSingleRegistrationStyle
Sets the target of the registration (used for metadata generation).
Public methodStatic memberUsingConstructorTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, IConstructorSelector)
Set the policy used to select from available constructors on the implementation type.
Public methodStatic memberUsingConstructorTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, ExpressionFuncTLimit)
Set the policy used to select from available constructors on the implementation type.
Public methodStatic memberUsingConstructorTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, Type)
Set the policy used to select from available constructors on the implementation type.
Public methodStatic memberWhereTLimit, TScanningActivatorData, TRegistrationStyle
Specifies a subset of types to register from a scanned assembly.
Public methodStatic memberWithMetadataTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, FuncType, IEnumerableKeyValuePairString, Object)
Specify how a type from a scanned assembly provides metadata.
Public methodStatic memberWithMetadataTLimit, TScanningActivatorData, TRegistrationStyle(IRegistrationBuilderTLimit, TScanningActivatorData, TRegistrationStyle, String, FuncType, Object)
Specify how a type from a scanned assembly provides metadata.
Public methodStatic memberWithMetadataFromTAttribute
Use the properties of an attribute (or interface implemented by an attribute) on the scanned type to provide metadata values.
Public methodStatic memberWithParameterTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, Parameter)
Configure an explicit value for a constructor parameter.
Public methodStatic memberWithParameterTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, FuncParameterInfo, IComponentContext, Boolean, FuncParameterInfo, IComponentContext, Object)
Configure an explicit value for a constructor parameter.
Public methodStatic memberWithParameterTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, String, Object)
Configure an explicit value for a constructor parameter.
Public methodStatic memberWithParametersTLimit, TReflectionActivatorData, TStyle
Configure explicit values for constructor parameters.
Public methodStatic memberWithPropertiesTLimit, TReflectionActivatorData, TStyle
Configure explicit values for properties.
Public methodStatic memberWithPropertyTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, Parameter)
Configure an explicit value for a property.
Public methodStatic memberWithPropertyTLimit, TReflectionActivatorData, TStyle(IRegistrationBuilderTLimit, TReflectionActivatorData, TStyle, String, Object)
Configure an explicit value for a property.
Top
See Also