Appends a new registration to a collection of registrations for the given
serviceType. Calls to Append can both preceed and follow a call to one
of the Container.Collections.Register
overloads.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
Parameters
- serviceType
- Type: SystemType
The service type of the collection. - registration
- Type: SimpleInjectorRegistration
The registration to append.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when one of the supplied arguments is a null reference. |
ArgumentException | Thrown when the serviceType is not a reference type, is open generic, or ambiguous. |
InvalidOperationException | Thrown when the container is locked. |
NotSupportedException | Thrown when the method is called for a registration that is made with one of the Collections.Register overloads that accepts a dynamic collection (an IEnumerable or IEnumerable<TService>). |
See Also