LifestyleCreateRegistrationCoreTService Method (FuncTService, Container)

Simple Injector
When overridden in a derived class, creates a new Registration instance defining the creation of the specified TService using the supplied instanceCreator with the caching as specified by this lifestyle.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 4.0.0

protected abstract Registration CreateRegistrationCore<TService>(
	Func<TService> instanceCreator,
	Container container
where TService : class


Type: SystemFuncTService
A delegate that will create a new instance of TService every time it is called.
Type: SimpleInjectorContainer
The Container instance for which a Registration must be created.

Type Parameters

The interface or base type that can be used to retrieve the instances.

Return Value

Type: Registration
A new Registration instance.

If you are implementing your own lifestyle, override this method to implement the code necessary to create and return a new Registration. Note that you should always create a new Registration instance. They should never be cached.
See Also