SimpleInjector Namespace

Simple Injector
The SimpleInjector namespace contains the core types to use when working with the library.
Classes

  ClassDescription
Public classActivationException
The standard exception thrown when a container has an error in resolving an object.
Public classConstructorResolutionBehaviorExtensions
Extension methods for IConstructorResolutionBehavior.
Public classContainer
The container. Create an instance of this type for registration of dependencies.
Public classContainerCollectionRegistrator
Contains methods for registering and creating collections in the Container.
Public classContainerLockingEventArgs
Provides data for and interaction with the ContainerLocking event of the ContainerOptions.
Public classCode exampleContainerOptions
Configuration options for the Container.
Public classContainerScope
The scope that manages the lifetime of singletons and other container-controlled instances.
Public classDecoratorContext
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.
Public classDecoratorPredicateContext
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.
Public classDependencyInjectionBehaviorExtensions
Extension methods for IDependencyInjectionBehavior.
Public classDependencyMetadataTService
Provides access to an injected dependency and its metadata.
Public classDiagnosticVerificationException
Thrown by the container in case of a diagnostic error.
Public classExpressionBuildingEventArgs
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.
Public classExpressionBuiltEventArgs
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.
Public classInjectionConsumerInfo
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.
Public classInjectionTargetInfo
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.
Public classCode exampleInstanceProducer
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).
Public classInstanceProducerTService
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).
Public classLifestyle
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.
Public classPredicateContext
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.
Public classCode exampleRegistration
A Registration implements lifestyle based caching for a single service and allows building an Expression that describes the creation of the service.
Public classScope
Implements a cache for ScopedLifestyle implementations.
Public classScopedLifestyle
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.
Public classSimpleInjectorWebApiExtensions
Extension methods for integrating Simple Injector with ASP.NET Web API applications.
Public classTypeFactoryContext
Contains contextual information for creating an implementation type.
Public classTypesExtensions
Useful extensions on Type.
Public classTypesToRegisterOptions
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.
Public classUnregisteredTypeEventArgs
Public classVisualizationOptions
Visualization options for providing various information about instances.
Delegates

  DelegateDescription
Public delegateCreateLifestyleApplier
Factory for the creation of a delegate that applies caching to the supplied transientInstanceCreator.
Public delegateResolveInterceptor
Enumerations

  EnumerationDescription
Public enumerationVerificationOption
This enumeration defines in which way the container should run the verification process.