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 classContainer
The container. Create an instance of this type for registration of dependencies.
Public classCode exampleContainerOptions
Configuration options for the Container.
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 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
Contains contextual information about the direct consumer for which the given dependency is injected into.
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 classPackageExtensions
Extension methods for working with packages.
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 open generic 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 classSimpleInjectorMvcExtensions
Extension methods for integrating Simple Injector with ASP.NET MVC applications.
Public classSimpleInjectorWcfExtensions
Extension methods for integrating Simple Injector with WCF services.
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
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.
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 has defines in which way the container should run the verification process.