Note: This API is now obsolete.
Registers a collection of singleton elements of type TService.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
[ObsoleteAttribute("Please use Container.Collection.Register instead. Will be removed in version 6.0.", true)] 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
Exception | Condition |
---|---|
InvalidOperationException | Thrown when this container instance is locked and can not be altered, or when a singletons for TService has already been registered. |
ArgumentNullException | Thrown when singletons is a null reference. |
ArgumentException | Thrown when one of the elements of singletons is a null reference. |
See Also