Registration Class

Simple Injector
A Registration implements lifestyle based caching for a single service and allows building an Expression that describes the creation of the service.
Inheritance Hierarchy

SystemObject
  SimpleInjectorRegistration

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

public abstract class Registration

The Registration type exposes the following members.

Constructors

  NameDescription
Protected methodRegistration
Initializes a new instance of the Registration class.
Top
Properties

  NameDescription
Public propertyContainer
Gets the Container instance for this registration.
Public propertyImplementationType
Gets the type that this instance will create.
Public propertyLifestyle
Gets the Lifestyle this that created this registration.
Public propertySuppressDisposal
Gets or sets a value indicating whether the disposal of created instances for this registration should be suppressed or not. The default is false. Having a value of false, does not force an instance to be disposed of, though; Transient instances, for instance, will never be disposed of.
Top
Methods

  NameDescription
Public methodBuildExpression
Builds a new Expression with the correct caching (according to the specifications of its Lifestyle) applied.
Protected methodBuildTransientDelegate
Protected methodBuildTransientExpression
Public methodGetRelationships
Gets the list of KnownRelationship instances. Note that the list is only available after calling BuildExpression.
Public methodInitializeInstance
Initializes an already created instance and applies properties and initializers to that instance.
Public methodSuppressDiagnosticWarning
Suppressing the supplied DiagnosticType for the given registration.
Top
Remarks

Lifestyle implementations create a new Registration instance for each registered service type. Expressions returned from the BuildExpression method can be intercepted by any event registered with ExpressionBuilding, have initializers applied, and the caching particular to its lifestyle have been applied. Interception using the Container.ExpressionBuilt will not be applied in the Registration, but will be applied in InstanceProducer.
Examples

See the Lifestyle documentation for an example.
See Also

Reference