Registers all concrete, non-generic, public and internal types in the given
assembly that implement the given openGenericServiceType
with the supplied lifestyle.
Decorators and
generic type definitions
will be excluded from registration, while
composites are included.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
public void Register( Type openGenericServiceType, Assembly assembly, Lifestyle lifestyle )
Parameters
- openGenericServiceType
- Type: SystemType
The definition of the open generic type. - assembly
- Type: System.ReflectionAssembly
An assembly that will be searched. - lifestyle
- Type: SimpleInjectorLifestyle
The lifestyle to register instances with.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when one of the arguments contain a null reference. |
ArgumentException | Thrown when openGenericServiceType is not an open generic type. |
InvalidOperationException | Thrown when the given assembly contain multiple types that implement the same closed generic version of the given openGenericServiceType. |
See Also