ContainerRegister Method (Type, IEnumerableAssembly)

Simple Injector
Registers all concrete, non-generic, public and internal types in the given set of assemblies that implement the given openGenericServiceType with container's default lifestyle (which is transient by default). Decorators and generic type definitions will be excluded from registration, while composites are included.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 4.0.0
Syntax

public void Register(
	Type openGenericServiceType,
	IEnumerable<Assembly> assemblies
)

Parameters

openGenericServiceType
Type: SystemType
The definition of the open generic type.
assemblies
Type: System.Collections.GenericIEnumerableAssembly
A list of assemblies that will be searched.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the arguments contain a null reference (Nothing in VB).
ArgumentExceptionThrown when openGenericServiceType is not an open generic type.
InvalidOperationExceptionThrown when the given set of assemblies contain multiple types that implement the same closed generic version of the given openGenericServiceType.
See Also

Reference