Note: This API is now obsolete.
Allows appending new registrations to existing registrations made using one of the
Collections.Register overloads.
Namespace: SimpleInjector.Advanced
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
[ObsoleteAttribute("Please use Container.Collection.Append instead. Will be removed in version 6.0.", true)] public static void AppendToCollection( this Container container, Type serviceType, Type implementationType )
Parameters
- container
- Type: SimpleInjectorContainer
The container. - serviceType
- Type: SystemType
The service type of the collection. - implementationType
- Type: SystemType
The implementation type to append.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Container. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).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, 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