The SimpleInjector namespace contains the core types to use when working with the library.
Classes
Class | Description | |
---|---|---|
ActivationException |
The standard exception thrown when a container has an error in resolving an object.
| |
ConstructorResolutionBehaviorExtensions |
Extension methods for IConstructorResolutionBehavior.
| |
Container |
The container. Create an instance of this type for registration of dependencies.
| |
ContainerCollectionRegistrator |
Contains methods for registering and creating collections in the Container.
| |
ContainerLockingEventArgs |
Provides data for and interaction with the
ContainerLocking event of
the ContainerOptions.
| |
ContainerOptions | Configuration options for the Container. | |
ContainerScope |
The scope that manages the lifetime of singletons and other container-controlled instances.
| |
DecoratorContext |
An instance of this type can be injected into constructors of decorator classes that are registered
using RegisterDecorator. This type contains
contextual information about the applied decoration and it allows users to examine the given instance
to make runtime decisions.
| |
DecoratorPredicateContext |
An instance of this type will be supplied to the PredicateT
delegate that is that is supplied to the
RegisterDecorator
overload that takes this delegate. This type contains information about the decoration that is about
to be applied and it allows users to examine the given instance to see whether the decorator should
be applied or not.
| |
DependencyInjectionBehaviorExtensions |
Extension methods for IDependencyInjectionBehavior.
| |
DependencyMetadataTService |
Provides access to an injected dependency and its metadata.
| |
DiagnosticVerificationException |
Thrown by the container in case of a diagnostic error.
| |
ExpressionBuildingEventArgs |
Provides data for and interaction with the
ExpressionBuilding event of
the Container. An observer can change the
Expression property to change the component that is
currently being built.
| |
ExpressionBuiltEventArgs |
Provides data for and interaction with the
ExpressionBuilt event of
the Container. An observer can change the
Expression property to change the component that is currently
being built.
| |
InjectionConsumerInfo |
Contextual information the a dependency and its direct consumer for which the dependency is injected
into. The consumer's type is given by the ImplementationType property, where the
Target property gives access to the consumer's target element (property or constructor
argument) in which the dependency will be injected, and the dependency's type information.
| |
InjectionTargetInfo |
Discovers the attributes of the code element (a property or parameter) where a dependency will be
injected into, and provides access to its meta data.
| |
InstanceProducer |
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, bool).
| |
InstanceProducerTService |
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).
| |
Lifestyle |
Instances returned from the container can be cached. The Container contains several
overloads of the Register method that take a Lifestyle instance as argument to define
how returned instances should be cached. The core library contains two lifestyles out of the box. By
supplying Lifestyle.Transient, the registered instance is not
cached; a new instance is returned every time it is requested or injected. By supplying
Lifestyle.Singleton instances can be cached indefinitely; only
a single instance of the registered component will be returned by that container instance. Other
lifestyles are defined in integration and extension packages. The
CreateCustom method allows defining a custom lifestyle and
the CreateHybrid method
allows creating a lifestyle that mixes multiple other lifestyles.
| |
PredicateContext |
An instance of this type will be supplied to the PredicateT
delegate that is that is supplied to the
RegisterConditional
overload that takes this delegate. This type contains information about the service that
is about to be created and it allows the user to examine the given instance to decide whether this
implementation should be created or not.
| |
Registration |
A Registration implements lifestyle based caching for a single service and allows building an
Expression that describes the creation of the service.
| |
Scope | Implements a cache for ScopedLifestyle implementations. | |
ScopedLifestyle |
Base class for scoped lifestyles. A scoped lifestyle caches instances for the duration of an implicitly
or explicitly defined scope. Such scope can be an (implicitly defined) web request or an explicitly
defined Lifetime Scope. The lifetime of instances registered with a scoped lifestyle is always equal
or bigger than one-instance-per-object-graph. In other words, a call to GetInstance() will never create
more than one instance of such registered type.
| |
SimpleInjectorWebApiExtensions |
Extension methods for integrating Simple Injector with ASP.NET Web API applications.
| |
TypeFactoryContext |
Contains contextual information for creating an implementation type.
| |
TypesExtensions | Useful extensions on Type. | |
TypesToRegisterOptions |
Defines options to control the types returned from the
GetTypesToRegister
method. For a type to be returned, it should match all the conditions described by the class's
properties. In other words, in case the searched assembly contains a generic type, that is both a
decorator and a composite, it will only be returned by GetTypesToRegister in case both
IncludeGenericTypeDefinitions, IncludeDecorators and
IncludeComposites are set to true.
| |
UnregisteredTypeEventArgs |
Provides data for and interaction with the
ResolveUnregisteredType event of
the Container. An observer can check the
UnregisteredServiceType to see whether the unregistered type can be handled. The
Register(FuncObject) method can be called to register a FuncTResult delegate
that allows creation of instances of the unregistered for this and future requests.
| |
VisualizationOptions |
Visualization options for providing various information about instances.
|
Delegates
Delegate | Description | |
---|---|---|
CreateLifestyleApplier |
Factory for the creation of a delegate that applies caching to the supplied
transientInstanceCreator.
| |
ResolveInterceptor |
Delegate that allows intercepting calls to GetInstance(Type) and
GetInstance.
|
Enumerations
Enumeration | Description | |
---|---|---|
VerificationOption |
This enumeration defines in which way the container should run the verification process.
|