ContainerAddRegistrationTService Method (Registration)

Simple Injector
Adds the registration for the supplied . This method can be used to apply the same Registration to multiple different service types.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax

public void AddRegistration<TService>(
	Registration registration
)
where TService : class

Parameters

registration
Type: SimpleInjectorRegistration
The registration that should be stored for the given .

Type Parameters

TService
The base type or interface to register.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the supplied arguments is a null reference.
ArgumentExceptionThrown when is ambiguous, when it is not assignable from the registration's ImplementationType or when the supplied registration is created for a different Container instance.
InvalidOperationException Thrown when this container instance is locked and can not be altered, or when an the has already been registered.
See Also

Reference