ContainerCollectionRegistratorAppend Method (Type, Type, Lifestyle)

Simple Injector
Appends a new registration of implementationType to a collection of registrations for the given serviceType using the supplied lifestyle. 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

public void Append(
	Type serviceType,
	Type implementationType,
	Lifestyle lifestyle
)

Parameters

serviceType
Type: SystemType
The service type of the collection.
implementationType
Type: SystemType
The implementation type to append.
lifestyle
Type: SimpleInjectorLifestyle
The lifestyle that specifies how the returned instance will be cached.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the supplied arguments is a null reference.
ArgumentExceptionThrown when the serviceType is not a reference type, or ambiguous.
InvalidOperationExceptionThrown when the container is locked.
NotSupportedExceptionThrown 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

Reference