ContainerRegisterCollectionTService Method (TService)

Simple Injector
Registers a collection of singleton elements of type TService.

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

public void RegisterCollection<TService>(
	params TService[] singletons
)
where TService : class

Parameters

singletons
Type: TService
The collection to register.

Type Parameters

TService
The interface or base type that can be used to retrieve instances.
Exceptions

ExceptionCondition
InvalidOperationException Thrown when this container instance is locked and can not be altered, or when a singletons for TService has already been registered.
ArgumentNullExceptionThrown when singletons is a null reference.
ArgumentExceptionThrown when one of the elements of singletons is a null reference.
See Also

Reference