Appends a new registration of TImplementation to a collection of
registrations for the given TService 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<TService, TImplementation>( Lifestyle lifestyle ) where TService : class where TImplementation : class, TService
Parameters
- lifestyle
- Type: SimpleInjectorLifestyle
The lifestyle that specifies how the returned instance will be cached.
Type Parameters
- TService
- The element type of the collections to register.
- TImplementation
- The concrete type that will be appended as registration to the collection.
Exceptions
Exception | Condition |
---|---|
ArgumentException | Thrown when the TServiceis ambiguous. |
ArgumentNullException | Thrown when lifestyle is a null reference. |
See Also