InstanceProducerTService Class

Simple Injector
Produces instances for a given registration. Instances of this type are generally created by the container when calling one of the Register overloads. Instances can be retrieved by calling GetCurrentRegistrations or GetRegistration(Type, Boolean).
Inheritance Hierarchy

SystemObject
  SimpleInjectorInstanceProducer
    SimpleInjectorInstanceProducerTService

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

public class InstanceProducer<TService> : InstanceProducer
where TService : class

Type Parameters

TService
The service type.

The InstanceProducerTService type exposes the following members.

Constructors

  NameDescription
Public methodInstanceProducerTService
Initializes a new instance of the InstanceProducerTService class.
Top
Properties

  NameDescription
Public propertyLifestyle
Gets the Lifestyle for this registration. The returned lifestyle can differ from the lifestyle that is used during the registration. This can happen for instance when the registration is changed by an ExpressionBuilt registration or gets decorated.
(Inherited from InstanceProducer.)
Public propertyRegistration
Gets the Registration instance for this instance.
(Inherited from InstanceProducer.)
Public propertyServiceType
Gets the service type for which this producer produces instances.
(Inherited from InstanceProducer.)
Top
Methods

  NameDescription
Public methodBuildExpression
Builds an expression that expresses the intent to get an instance by the current producer. A call to this method locks the container. No new registrations can't be made after a call to this method.
(Inherited from InstanceProducer.)
Public methodGetInstance
Produces an instance.
Public methodGetRelationships
Gets the collection of relationships for this instance that the container knows about. This includes relationships between the registered type and its dependencies and relationships between applied decorators and their dependencies. Note that types that are not newed up by the container and properties that are injected inside a custom delegate that is registered using the RegisterInitializer method are unknown to the container and are not returned from this method. Also note that this method will return an empty collection when called before the registered type is requested from the container (or before Verify is called).
(Inherited from InstanceProducer.)
Public methodVisualizeObjectGraph
Builds a string representation of the object graph with the current instance as root of the graph.
(Inherited from InstanceProducer.)
Top
See Also

Reference