Autofac Service used as a "flag" to indicate a particular component should be automatically activated on container build. Services are the lookup keys used to locate component instances. Returns a that represents the current . A that represents the current . Implements the operator ==. The left operand. The right operand. The result of the operator. Implements the operator !=. The left operand. The right operand. The result of the operator. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Gets a human-readable description of the service. The description. Determines whether the specified is equal to the current . The to compare with the current . if the specified is not and is an ; otherwise, . All services of this type are considered "equal." Serves as a hash function for a particular type. A hash code for the current . Always 0 for this type. All services of this type are considered "equal" and use the same hash code. Gets the service description. Always returns AutoActivate. Used with the WithMetadata configuration method to associate key-value pairs with an . Interface with properties whose names correspond to the property keys. This feature was suggested by OJ Reeves (@TheColonial). Set one of the property values. The type of the property. An expression that accesses the property to set. The property value to set. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot choose between multiple constructors with equal length {0} on type '{1}'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to {0} ---> {1} (See inner exception for details.). Well-known tags used in setting up matching lifetime scopes. Tag used in setting up per-request lifetime scope registrations (e.g., per-HTTP-request or per-API-request). Interface providing fluent syntax for chaining module registrations. Add a module to the container. The module to add. The to allow additional chained module registrations. Basic implementation of the interface allowing registration of modules into a in a fluent format. The into which registrations will be made. Initializes a new instance of the class. The into which registrations will be made. Thrown if is . Add a module to the container. The module to add. The to allow additional chained module registrations. Thrown if is . Support the System.Lazy<T, TMetadata> types automatically whenever type T is registered with the container. Metadata values come from the component registration's metadata. When a dependency of a lazy type is used, the instantiation of the underlying component will be delayed until the Value property is first accessed. Allows registrations to be made on-the-fly when unregistered services are requested (lazy registrations.) Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. If the source is queried for service s, and it returns a component that implements both s and s', then it will not be queried again for either s or s'. This means that if the source can return other implementations of s', it should return these, plus the transitive closure of other components implementing their additional services, along with the implementation of s. It is not an error to return components that do not implement . Gets whether the registrations provided by this source are 1:1 adapters on top of other components (I.e. like Meta, Func or Owned.) A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Lazy<T, TMetadata> Support. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The type '{0}' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.. Looks up a localized string similar to Export metadata for '{0}' is missing and no default value was supplied.. Provides a value along with metadata describing the value. The type of the value. An interface to which metadata values can be bound. Create a new instance. The value described by the instance. The metadata describing the value. The value described by . Metadata describing the value. Support the types automatically whenever type T is registered with the container. Metadata values come from the component registration's metadata. Finds constructors that match a finder function. Find suitable constructors from which to select. Finds suitable constructors on the target type. Type to search for constructors. Suitable constructors. Initializes a new instance of the class. Default to selecting all public constructors. Initializes a new instance of the class. The finder function. Finds suitable constructors on the target type. Type to search for constructors. Suitable constructors. Extension methods for configuring the . Fluent method for setting the registration configuration on . The registration source to configure. A configuration action that will run on any registration provided by the source. The with the registration configuration set. Extension methods for registering instances with a container. Registers modules found in an assembly. The builder to register the modules with. The assemblies from which to register modules. Thrown if is . The to allow additional chained module registrations. Registers modules found in an assembly. The module registrar that will make the registrations into the container. The assemblies from which to register modules. Thrown if is . The to allow additional chained module registrations. Registers modules found in an assembly. The builder to register the modules with. The assemblies from which to register modules. The type of the module to add. Thrown if is . The to allow additional chained module registrations. Registers modules found in an assembly. The module registrar that will make the registrations into the container. The assemblies from which to register modules. The type of the module to add. Thrown if is . The to allow additional chained module registrations. Registers modules found in an assembly. The builder to register the modules with. The of the module to add. The assemblies from which to register modules. Thrown if or is . The to allow additional chained module registrations. Registers modules found in an assembly. The module registrar that will make the registrations into the container. The of the module to add. The assemblies from which to register modules. Thrown if or is . The to allow additional chained module registrations. Add a module to the container. The builder to register the module with. The module to add. Thrown if is . The to allow additional chained module registrations. Add a module to the container. The module registrar that will make the registration into the container. The module to add. Thrown if is . The to allow additional chained module registrations. Add a module to the container. The builder to register the module with. The module to add. Thrown if or is . The to allow additional chained module registrations. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Module.ThisAssembly is only available in modules that inherit directly from Module.. Support the type automatically whenever type T is registered with the container. When a dependency of a lazy type is used, the instantiation of the underlying component will be delayed until the Value property is first accessed. Generates context-bound closures that represent factories from a set of heuristics based on delegate type signatures. Create a factory generator. The service that will be activated in order to create the products of the factory. The delegate to provide as a factory. The parameter mapping mode to use. Create a factory generator. The component that will be activated in order to create the products of the factory. The delegate to provide as a factory. The parameter mapping mode to use. Generates a factory delegate that closes over the provided context. The context in which the factory will be used. Parameters provided to the resolve call for the factory itself. A factory delegate that will work within the context. Generates a factory delegate that closes over the provided context. The context in which the factory will be used. Parameters provided to the resolve call for the factory itself. A factory delegate that will work within the context. Reflection activator data for concrete types. Builder for reflection-based activators. Specify a reflection activator for the given type. Type that will be activated. Get the implementation type. The constructor finder for the registration. The constructor selector for the registration. The explicitly bound constructor parameters. The explicitly bound properties. Activator data that can provide an IInstanceActivator instance. The instance activator based on the provided data. Specify a reflection activator for the given type. Type that will be activated. The instance activator based on the provided data. Parameterises the construction of a container by a . No options - the default behavior for container building. Prevents inclusion of standard modules like support for relationship types including etc. Does not call on components implementing this interface (useful for module testing.) Data structure used to construct registrations. The most specific type to which instances of the registration can be cast. Activator builder type. Registration style type. Configure the component so that instances are never disposed by the container. A registration builder allowing further configuration of the component. Configure the component so that instances that support IDisposable are disposed by the container (default.) A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() gets a new, unique instance (default.) A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() gets the same, shared instance. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a single ILifetimeScope gets the same, shared instance. Dependent components in different lifetime scopes will get different instances. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. Dependent components in lifetime scopes that are children of the tagged scope will share the parent's instance. If no appropriately tagged scope can be found in the hierarchy an is thrown. Tag applied to matching lifetime scopes. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. Service type. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. Service type. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. The service type provided by the component. Key to associate with the component. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. Service type. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. Service types to expose. A registration builder allowing further configuration of the component. Configure the services that the component will provide. Services to expose. A registration builder allowing further configuration of the component. Provide a textual name that can be used to retrieve the component. Named service to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a textual name that can be used to retrieve the component. Named service to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a key that can be used to retrieve the component. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a key that can be used to retrieve the component. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Add a handler for the Preparing event. This event allows manipulating of the parameters that will be provided to the component. The event handler. A registration builder allowing further configuration of the component. Add a handler for the Activating event. The event handler. A registration builder allowing further configuration of the component. Add a handler for the Activated event. The event handler. A registration builder allowing further configuration of the component. Configure the component so that any properties whose types are registered in the container will be wired to instances of the appropriate service. Set wiring options such as circular dependency wiring support. A registration builder allowing further configuration of the component. Associates data with the component. Key by which the data can be located. The data value. A registration builder allowing further configuration of the component. Associates data with the component. The extended properties to associate with the component. A registration builder allowing further configuration of the component. Associates data with the component. A type with properties whose names correspond to the property names to configure. A registration builder allowing further configuration of the component. The activator data. The registration style. The registration data. Delegates registration lookups to a specified registry. When write operations are applied, initialises a new 'writeable' registry. Safe for concurrent access by multiple readers. Write operations are single-threaded. Provides component registrations according to the services they provide. Attempts to find a default registration for the specified service. The service to look up. The default registration for the service. True if a registration exists. Determines whether the specified service is registered. The service to test. True if the service is registered. Register a component. The component registration. Register a component. The component registration. If true, existing defaults for the services provided by the component will not be changed. Selects from the available registrations after ensuring that any dynamic registration sources that may provide have been invoked. The service for which registrations are sought. Registrations supporting . Add a registration source that will provide registrations on-the-fly. The source to register. Enumerate the registered components. Fired whenever a component is registered - either explicitly or via a . Gets the registration sources that are used by the registry. True if the registry contains its own components; false if it is forwarding registrations from another external registry. This property is used when walking up the scope tree looking for registrations for a new customised scope. (See issue 336.) Fired when an is added to the registry. Enables contravariant Resolve() for interfaces that have a single contravariant ('in') parameter. interface IHandler<in TCommand> { void Handle(TCommand command); } class Command { } class DerivedCommand : Command { } class CommandHandler : IHandler<Command> { ... } var builder = new ContainerBuilder(); builder.RegisterSource(new ContravariantRegistrationSource()); builder.RegisterType<CommandHandler>(); var container = builder.Build(); // Source enables this line, even though IHandler<Command> is the // actual registered type. var handler = container.Resolve<IHandler<DerivedCommand>>(); handler.Handle(new DerivedCommand()); Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. If the source is queried for service s, and it returns a component that implements both s and s', then it will not be queried again for either s or s'. This means that if the source can return other implementations of s', it should return these, plus the transitive closure of other components implementing their additional services, along with the implementation of s. It is not an error to return components that do not implement . Gets whether the registrations provided by this source are 1:1 adapters on top of other components (I.e. like Meta, Func or Owned.) Options that can be applied when autowiring properties on a component. (Multiple options can be specified using bitwise 'or' - e.g. AllowCircularDependencies | PreserveSetValues. Default behavior. Circular dependencies are not allowed; existing non-default property values are overwritten. Allows property-property and property-constructor circular dependency wiring. This flag moves property wiring from the Activating to the Activated event. If specified, properties that already have a non-default value will be left unchanged in the wiring operation. Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}. To create an for a specific type, use: var cr = RegistrationBuilder.ForType(t).CreateRegistration(); The full builder syntax is supported: var cr = RegistrationBuilder.ForType(t).Named("foo").ExternallyOwned().CreateRegistration(); Creates a registration builder for the provided delegate. Instance type returned by delegate. Delegate to register. A registration builder. Creates a registration builder for the provided delegate. Delegate to register. Most specific type return value of delegate can be cast to. A registration builder. Creates a registration builder for the provided type. Implementation type to register. A registration builder. Creates a registration builder for the provided type. Implementation type to register. A registration builder. Create an from a . (There is no need to call this method when registering components through a .) When called on the result of one of the methods, the returned registration will be different from the one the builder itself registers in the container. var registration = RegistrationBuilder.ForType<Foo>().CreateRegistration(); The registration builder. An IComponentRegistration. Thrown if is . Create an IComponentRegistration from data. Id of the registration. Registration data. Activator. Services provided by the registration. An IComponentRegistration. Create an IComponentRegistration from data. Id of the registration. Registration data. Activator. Services provided by the registration. Optional; target registration. An IComponentRegistration. Thrown if or is . Register a component in the component registry. This helper method is necessary in order to execute OnRegistered hooks and respect PreserveDefaults. Hoping to refactor this out. Component registry to make registration in. Registration builder with data for new registration. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The type '{0}' is not assignable to service '{1}'.. Adds registration syntax for less commonly-used features. These features are in this namespace because they will remain accessible to applications originally written against Autofac 1.4. In Autofac 2, this functionality is implicitly provided and thus making explicit registrations is rarely necessary. Registers a factory delegate. Container builder. Factory type to generate. Registration builder allowing the registration to be configured. Factory delegates are provided automatically in Autofac 2, and this method is generally not required. Registers a factory delegate. Container builder. Factory type to generate. The service that the delegate will return instances of. Registration builder allowing the registration to be configured. Factory delegates are provided automatically in Autofac 2, and this method is generally not required. Registers a factory delegate. The type of the delegate. Container builder. The service that the delegate will return instances of. Registration builder allowing the registration to be configured. Factory delegates are provided automatically in Autofac 2, and this method is generally not required. Registers a factory delegate. The type of the delegate. Container builder. Registration builder allowing the registration to be configured. Factory delegates are provided automatically in Autofac 2, and this method is generally not required. Changes the parameter mapping mode of the supplied delegate type to match parameters by name. Factory delegate type Activator data type Registration style Registration to change parameter mapping mode of. Registration builder allowing the registration to be configured. Thrown if is . Changes the parameter mapping mode of the supplied delegate type to match parameters by position. Factory delegate type Activator data type Registration style Registration to change parameter mapping mode of. Registration builder allowing the registration to be configured. Thrown if is . Changes the parameter mapping mode of the supplied delegate type to match parameters by type. Factory delegate type Activator data type Registration style Registration to change parameter mapping mode of. Registration builder allowing the registration to be configured. Thrown if is . Registers the type as a collection. If no services or names are specified, the default services will be IList<T>, ICollection<T>, and IEnumerable<T> The type of the collection elements. Container builder. A unique name for the collection that can be passed to MemberOf(). Registration builder allowing the registration to be configured. Collections are provided automatically in Autofac 2, and this method is generally not required. Registers the type as a collection. If no services or names are specified, the default services will be IList<T>, ICollection<T>, and IEnumerable<T> The type of the collection elements. Container builder. A unique name for the collection that can be passed to MemberOf(). Registration builder allowing the registration to be configured. Collections are provided automatically in Autofac 2, and this method is generally not required. Include the element explicitly in a collection configured using RegisterCollection. Registration limit type. Registration style. Activator data type. Registration to export. The collection name, as passed to RegisterCollection. A registration builder allowing further configuration of the component. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Build() or Update() can only be called once on a ContainerBuilder.. Looks up a localized string similar to An error occurred while attempting to automatically activate registration '{0}'. See the inner exception for information on the source of the failure.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to A delegate registered to create instances of '{0}' returned null.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Bound constructor '{0}'.. Looks up a localized string similar to The binding cannot be instantiated.. Looks up a localized string similar to An exception was thrown while invoking the constructor '{0}' on type '{1}'.. Looks up a localized string similar to Cannot resolve parameter '{1}' of constructor '{0}'.. Provides parameters that have a default value, set with an optional parameter declaration in C# or VB. Used in order to provide a value to a constructor parameter or property on an instance being created by the container. Not all parameters can be applied to all sites. Returns true if the parameter is able to provide a value to a particular site. Constructor, method, or property-mutator parameter. The component context in which the value is being provided. If the result is true, the valueProvider parameter will be set to a function that will lazily retrieve the parameter value. If the result is false, will be set to null. True if a value can be supplied; otherwise, false. Returns true if the parameter is able to provide a value to a particular site. Constructor, method, or property-mutator parameter. The component context in which the value is being provided. If the result is true, the valueProvider parameter will be set to a function that will lazily retrieve the parameter value. If the result is false, will be set to null. True if a value can be supplied; otherwise, false. Thrown if is . A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The container's self-registration of context interfaces should never be activated as it is hard-wired into the LifetimeScope class.. Marks a module as container-aware (for the purposes of attaching to diagnostic events.) Initialise the module with the container into which it is being registered. The container. Fired when the activation process for a new instance is complete. The context in which the activation occurred. The component providing the instance. The paramters provided when resolved. The instance that will be used to satisfy the request. Fired after the construction of an instance but before that instance is shared with any other or any members are invoked on it. The instance can be replaced if needed, e.g. by an interface proxy. The object to use instead of the activated instance. The context in which the activation occurred. The component providing the instance. The instance that will be used to satisfy the request. The parameters supplied to the activator. Interface supported by services that carry type information. Return a new service of the same kind, but carrying as the . The new service type. A new service with the service type. Gets the type of the service. The type of the service. Identifies a service using a key in addition to its type. Initializes a new instance of the class. Key of the service. Type of the service. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Return a new service of the same kind, but carrying as the . The new service type. A new service with the service type. Gets or sets the key of the service. The key of the service. Gets the type of the service. The type of the service. Gets a human-readable description of the service. The description. Describes when a lifetime scope is beginning. Create an instance of the class. The lifetime scope that is beginning. The lifetime scope that is beginning. Describes when a lifetime scope is ending. Create an instance of the class. The lifetime scope that is ending. The lifetime scope that is ending. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.. Fired when an is added to the registry. Construct an instance of the class. The registry to which the source was added. The source that was added. The registry to which the source was added. The source that was added. Represents the process of finding a component during a resolve operation. The component for which an instance is to be looked up. The scope in which the instance will be looked up. The parameters provided for new instance creation. Raised when the lookup phase of the operation is ending. Raised when the completion phase of an instance lookup operation begins. Raised when the completion phase of an instance lookup operation ends. Raised when the completion phase of an instance lookup operation begins. Create an instance of the class. The instance lookup that is beginning the completion phase. The instance lookup operation that is beginning the completion phase. Raised when the completion phase of an instance lookup operation ends. Create an instance of the class. The instance lookup that is ending the completion phase. The instance lookup operation that is ending the completion phase. Fired when an instance is looked up. Create an instance of the class. The instance lookup that is ending. True if a new instance was created as part of the operation. True if a new instance was created as part of the operation. The instance lookup operation that is ending. Fired when instance lookup is complete. The instance lookup that is ending. The instance lookup operation that is beginning. Describes the commencement of a new resolve operation. Create an instance of the class. The resolve operation that is beginning. The resolve operation that is beginning. Wraps a component registration, switching its lifetime. Base class for disposable objects. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Returns true if the current instance has been disposed; otherwise false; Describes a logical component within the container. Called by the container when an instance is required. The context in which the instance will be activated. Parameters for activation. These may be modified by the event handler. Called by the container once an instance has been constructed. The context in which the instance was activated. The parameters supplied to the activator. The instance. Called by the container once an instance has been fully constructed, including any requested objects that depend on the instance. The context in which the instance was activated. The parameters supplied to the activator. The instance. A unique identifier for this component (shared in all sub-contexts.) This value also appears in Services. The activator used to create instances. The lifetime associated with the component. Whether the component instances are shared or not. Whether the instances of the component should be disposed by the container. The services provided by the component. Additional data associated with the component. The component registration upon which this registration is based. Fired when a new instance is required. The instance can be provided in order to skip the regular activator, by setting the Instance property in the provided event arguments. Fired when a new instance is being activated. The instance can be wrapped or switched at this time by setting the Instance property in the provided event arguments. Fired when the activation process for a new instance is complete. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Activator = {0}, Services = [{1}], Lifetime = {2}, Sharing = {3}, Ownership = {4}. Pulls registrations from another component registry. Excludes most auto-generated registrations - currently has issues with collection registrations. Create an external registry source that draws components from . Component registry to pull registrations from. Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. In this case because the components that are adapted do not come from the same logical scope, we must return false to avoid duplicating them. Switches components with a RootScopeLifetime (singletons) with decorators exposing MatchingScopeLifetime targeting the specified scope. Maps services onto the components that provide them. The component registry provides services directly from components, and also uses to generate components on-the-fly or as adapters for other components. A component registry is normally used through a , and not directly by application code. Protects instance variables from concurrent access. External registration sources. All registrations. Keeps track of the status of registered services. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Attempts to find a default registration for the specified service. The service to look up. The default registration for the service. True if a registration exists. Determines whether the specified service is registered. The service to test. True if the service is registered. Register a component. The component registration. Register a component. The component registration. If true, existing defaults for the services provided by the component will not be changed. Selects from the available registrations after ensuring that any dynamic registration sources that may provide have been invoked. The service for which registrations are sought. Registrations supporting . Add a registration source that will provide registrations on-the-fly. The source to register. Enumerate the registered components. Fired whenever a component is registered - either explicitly or via a . Gets the registration sources that are used by the registry. True if the registry contains its own components; false if it is forwarding registrations from another external registry. This property is used when walking up the scope tree looking for registrations for a new customised scope. (See issue 336.) Fired when an is added to the registry. Tracks the services known to the registry. Used for bookkeeping so that the same source is not queried twice (may be null.) Initializes a new instance of the class. The tracked service. The first time a service is requested, initialization (e.g. reading from sources) happens. This value will then be set to true. Calling many methods on this type before initialisation is an error. The known implementations. True if any implementations are known. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The operation is only valid during initialization.. Looks up a localized string similar to The operation is not valid until the object is initialized.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The activation has already been executed.. Describes the commencement of a new resolve operation. Create an instance of the class. The resolve operation that is ending. If included, the exception causing the operation to end; otherwise, null. The exception causing the operation to end, or null. The resolve operation that is ending. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Subclasses of Autofac.Service must override Object.Equals(). Looks up a localized string similar to Subclasses of Autofac.Service must override Object.GetHashCode(). A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Collection Support (Arrays and Generic Collection Interfaces). A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Lazy<T> Support. Describes the basic requirements for generating a lightweight adapter. Create an instance of . The service that will be adapted from. The adapter function. The adapter function. The service to be adapted from. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Lightweight Adapter from {0} to {1}. Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. Internal implementation of the RegisterCollection/MemberOf-style collection feature. Registration style for dynamic registrations. Data used to create factory activators. Create a new GeneratedFactoryActivatorData The type of the factory. The service used to provide the products of the factory. Determines how the parameters of the delegate type are passed on to the generated Resolve() call as Parameter objects. For Func-based delegates, this defaults to ByType. Otherwise, the parameters will be mapped by name. Activator data that can provide an IInstanceActivator instance. Hides standard Object members to make fluent interfaces easier to read. Based on blog post by @kzu here: http://www.clariusconsulting.net/blogs/kzu/archive/2008/03/10/58301.aspx Standard System.Object member. Standard result. Standard System.Object member. Standard result. Standard System.Object member. Standard result. Standard System.Object member. The other. Standard result. Determines how the parameters of the delegate type are passed on to the generated Resolve() call as Parameter objects. Chooses parameter mapping based on the factory type. For Func-based factories this is equivalent to ByType, for all others ByName will be used. Pass the parameters supplied to the delegate through to the underlying registration as NamedParameters based on the parameter names in the delegate type's formal argument list. Pass the parameters supplied to the delegate through to the underlying registration as TypedParameters based on the parameter types in the delegate type's formal argument list. Pass the parameters supplied to the delegate through to the underlying registration as PositionalParameters based on the parameter indices in the delegate type's formal argument list. Provides components by lookup operations via an index (key) type. The type of the index. The service provided by the indexed components. Retrieving a value given a key: IIndex<AccountType, IRenderer> accountRenderers = // ... var renderer = accountRenderers[AccountType.User]; Get the value associated with if any is available. The key to look up. The retrieved value. True if a value associated with the key exists. Get the value associated with . The value to retrieve. The associated value. Support the types automatically whenever type T is registered with the container. Metadata values come from the component registration's metadata. Provides a value along with a dictionary of metadata describing the value. The type of the value. Create a new instance. The value described by the instance. The metadata describing the value. The value described by . Metadata describing the value. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Meta<T> Support. Looks up a localized string similar to Meta<T, TMetadata> Support. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The service '{0}' is not an open generic type.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to {0} providing {1}. Describes the activator for an open generic decorator. Construct an . The decorator type. The open generic service type to decorate. The open generic service type to decorate. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. Looks up a localized string similar to Open Generic Decorator {0} from {1} to {2}. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The type {0} is not an open generic type definition.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The type '{0}' does not implement the interface '{1}'.. Looks up a localized string similar to The implementation type '{0}' is not an open generic type definition.. Looks up a localized string similar to The implementation type '{0}' does not support the interface '{1}'.. Looks up a localized string similar to The service '{0}' is not an open generic type definition.. Looks up a localized string similar to The service '{1}' is not assignable from implementation type '{0}'.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Owned<T> Support. Provides registrations on-the-fly for any concrete type not already registered with the container. Initializes a new instance of the class. Initializes a new instance of the class. A predicate that selects types the source will register. Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. Returns a that represents the current . A that represents the current . 2 Gets whether the registrations provided by this source are 1:1 adapters on top of other components (I.e. like Meta, Func or Owned.) Gets or sets an expression used to configure generated registrations. A that can be used to modify the behavior of registrations that are generated by this source. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to "Resolve Anything" Support. Activation data for types located by scanning assemblies. Create an instance of . The filters applied to the types from the scanned assembly. Additional actions to be performed on the concrete type registrations. Actions to be called once the scanning operation is complete. Fired when the activation process for a new instance is complete. Initializes a new instance of the class. The context. The component. The parameters. The instance. The context in which the activation occurred. The component providing the instance. The paramters provided when resolved. The instance that will be used to satisfy the request. Fired after the construction of an instance but before that instance is shared with any other or any members are invoked on it. Initializes a new instance of the class. The context. The component. The parameters. The instance. The instance can be replaced if needed, e.g. by an interface proxy. The object to use instead of the activated instance. The context in which the activation occurred. The component providing the instance. The instance that will be used to satisfy the request. The instance can be replaced if needed, e.g. by an interface proxy. The parameters supplied to the activator. Activate instances using a delegate. Base class for instance activators. Create an instance activator that will return instances compatible with . Most derived type to which instances can be cast. Gets a string representation of the activator. A string describing the activator. The most specific type that the component instances are known to be castable to. Activates component instances. Activate an instance in the provided context. Context in which to activate instances. Parameters to the instance. The activated instance. The context parameter here should probably be ILifetimeScope in order to reveal Disposer, but will wait until implementing a concrete use case to make the decision The most specific type that the component instances are known to be castable to. Create a delegate activator. The most specific type to which activated instances can be cast. Activation delegate. Activate an instance in the provided context. Context in which to activate instances. Parameters to the instance. The activated instance. The context parameter here should probably be ILifetimeScope in order to reveal Disposer, but will wait until implementing a concrete use case to make the decision Provides a pre-constructed instance. Provide the specified instance. The instance to provide. Activate an instance in the provided context. Context in which to activate instances. Parameters to the instance. The activated instance. The context parameter here should probably be ILifetimeScope in order to reveal Disposer, but will wait until implementing a concrete use case to make the decision Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Determines whether the activator disposes the instance that it holds. Necessary because otherwise instances that are never resolved will never be disposed. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The provided instance has already been used in an activation request. Did you combine a provided instance with non-root/single-instance lifetime/sharing?. Supplies values based on the target parameter type. Returns true if the parameter is able to provide a value to a particular site. Constructor, method, or property-mutator parameter. The component context in which the value is being provided. If the result is true, the valueProvider parameter will be set to a function that will lazily retrieve the parameter value. If the result is false, will be set to null. True if a value can be supplied; otherwise, false. Thrown if or is . Binds a constructor to the parameters that will be used when it is invoked. Construct a new ConstructorParameterBinding. ConstructorInfo to bind. Available parameters. Context in which to construct instance. Invoke the constructor with the parameter bindings. The constructed instance. Returns a System.String that represents the current System.Object. A System.String that represents the current System.Object. The constructor on the target type. The actual constructor used might differ, e.g. if using a dynamic proxy. True if the binding is valid. Describes the constructor parameter binding. Selects the best constructor from a set of available constructors. Selects the best constructor from the available constructors. Available constructors. The best constructor. Selects a constructor based on its signature. Match constructors with the provided signature. Signature to match. Selects the best constructor from the available constructors. Available constructors. The best constructor. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to At least one binding must be provided in order to select a constructor.. Looks up a localized string similar to The required constructor on type '{0}' with signature '{1}' is unavailable.. Looks up a localized string similar to More than one constructor matches the signature '{0}'.. Selects the constructor with the most parameters. Selects the best constructor from the available constructors. Available constructors. The best constructor. A single unambiguous match could not be chosen. Uses reflection to activate instances of a type. Create an activator for the provided type. Type to activate. Constructor finder. Constructor selector. Parameters configured explicitly for this instance. Properties configured explicitly for this instance. Activate an instance in the provided context. Context in which to activate instances. Parameters to the instance. The activated instance. The context parameter here should probably be ILifetimeScope in order to reveal Disposer, but will wait until implementing a concrete use case to make the decision The constructor finder. The constructor selector. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to No constructors on type '{0}' can be found with the constructor finder '{1}'.. Looks up a localized string similar to None of the constructors found with '{0}' on type '{1}' can be invoked with the available services and parameters:{2}. Base class for parameters that provide a constant value. Create a constant parameter that will apply to parameters matching the supplied predicate. Returns true if the parameter is able to provide a value to a particular site. Constructor, method, or property-mutator parameter. The component context in which the value is being provided. If the result is true, the valueProvider parameter will be set to a function that will lazily retrieve the parameter value. If the result is false, will be set to null. True if a value can be supplied; otherwise, false. The value of the parameter. Standard container implementation. Creates, wires dependencies and manages lifetime for a set of components. Most instances of are created by a . // See ContainerBuilder for the definition of the builder variable using (var container = builder.Build()) { var program = container.Resolve<Program>(); program.Run(); } Most functionality is provided by extension methods on the inherited interface. An tracks the instantiation of component instances. It defines a boundary in which instances are shared and configured. Disposing an will dispose the components that were resolved through it. // See IContainer for definition of the container variable using (var requestScope = container.BeginLifetimeScope()) { // Note that handler is resolved from requestScope, not // from the container: var handler = requestScope.Resolve<IRequestHandler>(); handler.Handle(request); // When requestScope is disposed, all resources used in processing // the request will be released. } All long-running applications should resolve components via an . Choosing the duration of the lifetime is application- specific. The standard Autofac WCF and ASP.NET/MVC integrations are already configured to create and release s as appropriate. For example, the ASP.NET integration will create and release an per HTTP request. Most functionality is provided by extension methods on the inherited interface. The context in which a service can be accessed or a component's dependencies resolved. Disposal of a context will dispose any owned components. Resolve an instance of the provided registration within the context. The registration. Parameters for the instance. The component instance. Associates services with the components that provide them. Begin a new nested scope. Component instances created via the new scope will be disposed along with it. A new lifetime scope. Begin a new nested scope. Component instances created via the new scope will be disposed along with it. The tag applied to the . A new lifetime scope. Begin a new nested scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. The components registered in the sub-scope will be treated as though they were registered in the root scope, i.e., SingleInstance() components will live as long as the root scope. Action on a that adds component registations visible only in the new scope. A new lifetime scope. Begin a new nested scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. The components registered in the sub-scope will be treated as though they were registered in the root scope, i.e., SingleInstance() components will live as long as the root scope. The tag applied to the . Action on a that adds component registations visible only in the new scope. A new lifetime scope. The disposer associated with this . Component instances can be associated with it manually if required. Typical usage does not require interaction with this member- it is used when extending the container. The tag applied to the . Tags allow a level in the lifetime hierarchy to be identified. In most applications, tags are not necessary. Fired when a new scope based on the current scope is beginning. Fired when this scope is ending. Fired when a resolve operation is beginning in this scope. Create a new container. Begin a new sub-scope. Instances created via the sub-scope will be disposed along with it. A new lifetime scope. Begin a new sub-scope. Instances created via the sub-scope will be disposed along with it. The tag applied to the . A new lifetime scope. Begin a new nested scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. Action on a that adds component registations visible only in the new scope. A new lifetime scope. Begin a new nested scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. The tag applied to the . Action on a that adds component registations visible only in the new scope. A new lifetime scope. Resolve an instance of the provided registration within the context. The registration. Parameters for the instance. The component instance. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Gets the service object of the specified type. An object that specifies the type of service object to get. A service object of type .-or- null if there is no service object of type . The disposer associated with this container. Instances can be associated with it manually if required. Tag applied to the lifetime scope. The tag applied to this scope and the contexts generated when it resolves component dependencies. Fired when a new scope based on the current scope is beginning. Fired when this scope is ending. Fired when a resolve operation is beginning in this scope. Associates services with the components that provide them. Base exception type thrown whenever the dependency resolution process fails. This is a fatal exception, as Autofac is unable to 'roll back' changes to components that may have already been made during the operation. For example, 'on activated' handlers may have already been fired, or 'single instance' components partially constructed. Initializes a new instance of the class. The message. Initializes a new instance of the class. The message. The inner exception. Gets a message that describes the current exception. The error message that explains the reason for the exception, or an empty string(""). Maintains a set of objects to dispose, and disposes them in the reverse order from which they were added when the Disposer is itself disposed. Provided on an object that will dispose of other objects when it is itself disposed. Adds an object to the disposer. When the disposer is disposed, so will the object be. The instance. Contents all implement IDisposable. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Adds an object to the disposer. When the disposer is disposed, so will the object be. The instance. Locates the lifetime to which instances of a component should be attached. Given the most nested scope visible within the resolve operation, find the scope for the component. The most nested visible scope. The scope for the component. Represents a set of components and related functionality packaged together. Apply the module to the component registry. Component registry to apply configuration to. Determines when instances supporting IDisposable are disposed. The lifetime scope does not dispose the instances. The instances are disposed when the lifetime scope is disposed. Determines whether instances are shared within a lifetime scope. Each request for an instance will return a new object. Each request for an instance will return the same object. Defines a nested structure of lifetimes. Try to retrieve an instance based on a GUID key. If the instance does not exist, invoke to create it. Key to look up. Creation function. An instance. The root of the sharing hierarchy. The parent of this node of the hierarchy, or null. Attaches the instance's lifetime to the current lifetime scope. Given the most nested scope visible within the resolve operation, find the scope for the component. The most nested visible scope. The scope for the component. Lifetime scope implementation. Protects shared instances from concurrent access. Other members and the base class are threadsafe. The tag applied to root scopes when no other tag is specified. Create a lifetime scope for the provided components and nested beneath a parent. The tag applied to the . Components used in the scope. Parent scope. Create a root lifetime scope for the provided components. The tag applied to the . Components used in the scope. Create a root lifetime scope for the provided components. Components used in the scope. Begin a new anonymous sub-scope. Instances created via the sub-scope will be disposed along with it. A new lifetime scope. Begin a new tagged sub-scope. Instances created via the sub-scope will be disposed along with it. The tag applied to the . A new lifetime scope. Begin a new anonymous sub-scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. Action on a that adds component registations visible only in the new scope. A new lifetime scope. IContainer cr = // ... using (var lifetime = cr.BeginLifetimeScope(builder => { builder.RegisterType<Foo>(); builder.RegisterType<Bar>().As<IBar>(); }) { var foo = lifetime.Resolve<Foo>(); } Begin a new tagged sub-scope, with additional components available to it. Component instances created via the new scope will be disposed along with it. The tag applied to the . Action on a that adds component registations visible only in the new scope. A new lifetime scope. IContainer cr = // ... using (var lifetime = cr.BeginLifetimeScope("unitOfWork", builder => { builder.RegisterType<Foo>(); builder.RegisterType<Bar>().As<IBar>(); }) { var foo = lifetime.Resolve<Foo>(); } Resolve an instance of the provided registration within the context. The registration. Parameters for the instance. The component instance. Try to retrieve an instance based on a GUID key. If the instance does not exist, invoke to create it. Key to look up. Creation function. An instance. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Gets the service object of the specified type. An object that specifies the type of service object to get. A service object of type .-or- null if there is no service object of type . The parent of this node of the hierarchy, or null. The root of the sharing hierarchy. The disposer associated with this container. Instances can be associated with it manually if required. Tag applied to the lifetime scope. The tag applied to this scope and the contexts generated when it resolves component dependencies. Associates services with the components that provide them. Fired when a new scope based on the current scope is beginning. Fired when this scope is ending. Fired when a resolve operation is beginning in this scope. Attaches the component's lifetime to scopes matching a supplied expression. Match scopes by comparing tags for equality. The tags applied to matching scopes. Given the most nested scope visible within the resolve operation, find the scope for the component. The most nested visible scope. The scope for the component. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to No scope with a Tag matching '{0}' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.. Attaches the component's lifetime to the root scope. Given the most nested scope visible within the resolve operation, find the scope for the component. The most nested visible scope. The scope for the component. A property identified by name. When applied to a reflection-based component, the name will be matched against property names. Create a with the specified constant value. The name of the property. The property value. The name of the property. Fired before the activation process to allow parameters to be changed or an alternative instance to be provided. Initializes a new instance of the class. The context. The component. The parameters. The context in which the activation is occurring. The component providing the instance being activated. The parameters supplied to the activator. A service was requested that cannot be provided by the container. To avoid this exception, either register a component to provide the required service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency. This exception is fatal. See for more information. Initializes a new instance of the class. The service. Initializes a new instance of the class. The service. The inner exception. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The requested service '{0}' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.. Information about the ocurrence of a component being registered with a container. Create a new instance with a valid container and component registration. The container into which the registration was made. The component registration. The container into which the registration was made. The component registration. Describes a logical component within the container. Create a new component registration. Unique identifier for the component. Activator used to activate instances. Determines how the component will be associated with its lifetime. Whether the component is shared within its lifetime scope. Whether the component instances are disposed at the end of their lifetimes. Services the component provides. Data associated with the component. Create a new component registration. Unique identifier for the component. Activator used to activate instances. Determines how the component will be associated with its lifetime. Whether the component is shared within its lifetime scope. Whether the component instances are disposed at the end of their lifetimes. Services the component provides. Data associated with the component. The component registration upon which this registration is based. Called by the container when an instance is required. The context in which the instance will be activated. Parameters for activation. Called by the container once an instance has been constructed. The context in which the instance was activated. The parameters supplied to the activator. The instance. Called by the container once an instance has been fully constructed, including any requested objects that depend on the instance. The context in which the instance was activated. The parameters supplied to the activator. The instance. Describes the component in a human-readable form. A description of the component. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. The component registration upon which this registration is based. If this registration was created directly by the user, returns this. A unique identifier for this component (shared in all sub-contexts.) This value also appears in Services. The activator used to create instances. The lifetime associated with the component. Whether the component instances are shared or not. Whether the instances of the component should be disposed by the container. The services provided by the component. Additional data associated with the component. Fired when a new instance is required. The instance can be provided in order to skip the regular activator, by setting the Instance property in the provided event arguments. Fired when a new instance is being activated. The instance can be wrapped or switched at this time by setting the Instance property in the provided event arguments. Fired when the activation process for a new instance is complete. Catch circular dependencies that are triggered by post-resolve processing (e.g. 'OnActivated') A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Circular component dependency detected: {0}.. Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. An is a component context that sequences and monitors the multiple activations that go into producing a single requested object graph. Get or create and share an instance of in the . The scope in the hierarchy in which the operation will begin. The component to resolve. Parameters for the component. The component instance. Raised when the entire operation is complete. Raised when an instance is looked up within the operation. A is a component context that sequences and monitors the multiple activations that go into producing a single requested object graph. Create an instance of in the provided scope. The most nested scope in which to begin the operation. The operation can move upward to less nested scopes as components with wider sharing scopes are activated Resolve an instance of the provided registration within the context. The registration. Parameters for the instance. The component instance. Execute the complete resolve operation. Continue building the object graph by instantiating in the current . The current scope of the operation. The component to activate. The parameters for the component. The resolved instance. Associates services with the components that provide them. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to An exception was thrown while executing a resolve operation. See the InnerException for details.. Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. Looks up a localized string similar to This resolve operation has already ended. When registering components using lambdas, the IComponentContext 'c' parameter to the lambda cannot be stored. Instead, either resolve IComponentContext again from 'c', or resolve a Func<> based factory to create subsequent components from.. Identifies a service according to a type to which it can be assigned. Initializes a new instance of the class. Type of the service. Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Return a new service of the same kind, but carrying as the . The new service type. A new service with the service type. Gets the type of the service. The type of the service. Gets a human-readable description of the service. The description. A handy unique service identifier type - all instances will be regarded as unequal. Initializes a new instance of the class. Initializes a new instance of the class. The id. Determines whether the specified is equal to the current . The to compare with the current . true if the specified is equal to the current ; otherwise, false. The parameter is null. Serves as a hash function for a particular type. A hash code for the current . Provides a programmer-readable description of the identifying feature of the service. Registration source providing implicit collection/list/enumerable support. This registration source provides enumerable support to allow resolving the set of all registered services of a given type. What may not be immediately apparent is that it also means any time there are no items of a particular type registered, it will always return an empty set rather than or throwing an exception. This is by design. Consider the [possibly majority] use case where you're resolving a set of message handlers or event handlers from the container. If there aren't any handlers, you want an empty set - not or an exception. It's valid to have no handlers registered. This implicit support means other areas (like MVC support or manual property injection) must take care to only request enumerable values they expect to get something back for. In other words, "Don't ask the container for something you don't expect to resolve." Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. Generates activators for open generic types. Represents a dependency that can be released by the dependent component. The service provided by the dependency. Autofac automatically provides instances of whenever the service is registered. It is not necessary for , or the underlying component, to implement . Disposing of the object is the correct way to handle cleanup of the dependency, as this will dispose of any other components created indirectly as well. When is resolved, a new is created for the underlying , and tagged with the service matching , generally a . This means that shared instances can be tied to this scope by registering them as InstancePerMatchingLifetimeScope(new TypedService(typeof(T))). The component D below is disposable and implements IService: public class D : IService, IDisposable { // ... } The dependent component C can dispose of the D instance whenever required by taking a dependency on : public class C { IService _service; public C(Owned<IService> service) { _service = service; } void DoWork() { _service.Value.DoSomething(); } void OnFinished() { _service.Dispose(); } } In general, rather than depending on directly, components will depend on System.Func<Owned<T>> in order to create and dispose of other components as required. Create an instance of . The value representing the instance. An IDisposable interface through which ownership can be released. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. The owned value. Generates registrations for services of type whenever the service T is available. Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. When implemented by a component, an instance of the component will be resolved and started as soon as the container is built. Autofac will not call the Start() method when subsequent instances are resolved. If this behavior is required, use an OnActivated() event handler instead. For equivalent "Stop" functionality, implement . Autofac will always dispose a component before any of its dependencies (except in the presence of circular dependencies, in which case the components in the cycle are disposed in reverse-construction order.) Perform once-off startup processing. Base class for user-defined modules. Modules can add a set of releated components to a container () or attach cross-cutting functionality to other components (. Modules are given special support in the XML configuration feature - see http://code.google.com/p/autofac/wiki/StructuringWithModules. Provides a user-friendly way to implement via . Defining a module: public class DataAccessModule : Module { public string ConnectionString { get; set; } public override void Load(ContainerBuilder moduleBuilder) { moduleBuilder.RegisterGeneric(typeof(MyRepository<>)) .As(typeof(IRepository<>)) .InstancePerMatchingLifetimeScope(WebLifetime.Request); moduleBuilder.Register(c => new MyDbConnection(ConnectionString)) .As<IDbConnection>() .InstancePerMatchingLifetimeScope(WebLifetime.Request); } } Using the module: var builder = new ContainerBuilder(); builder.RegisterModule(new DataAccessModule { ConnectionString = "..." }); var container = builder.Build(); var customers = container.Resolve<IRepository<Customer>>(); Apply the module to the component registry. Component registry to apply configuration to. Override to add registrations to the container. Note that the ContainerBuilder parameter is unique to this module. The builder through which components can be registered. Override to attach module-specific functionality to a component registration. This method will be called for all existing and future component registrations - ordering is not important. The component registry. The registration to attach functionality to. Override to perform module-specific processing on a registration source. This method will be called for all existing and future sources - ordering is not important. The component registry into which the source was added. The registration source. The assembly in which the concrete module type is located. To avoid bugs whereby deriving from a module will change the target assembly, this property can only be used by modules that inherit directly from . Configure the component so that instances are never disposed by the container. A registration builder allowing further configuration of the component. Configure the component so that instances that support IDisposable are disposed by the container (default.) A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() gets a new, unique instance (default.) A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() gets the same, shared instance. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a single ILifetimeScope gets the same, shared instance. Dependent components in different lifetime scopes will get different instances. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. Dependent components in lifetime scopes that are children of the tagged scope will share the parent's instance. If no appropriately tagged scope can be found in the hierarchy an is thrown. Tag applied to matching lifetime scopes. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. The service type provided by the component. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. The service type provided by the component. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. The service type provided by the component. Key to associate with the component. A registration builder allowing further configuration of the component. Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an is thrown. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. The generic parameter(s) to As() will be exposed as TypedService instances. Service type. Service type. Service type. A registration builder allowing further configuration of the component. Configure the services that the component will provide. Service types to expose. A registration builder allowing further configuration of the component. Configure the services that the component will provide. Services to expose. A registration builder allowing further configuration of the component. Provide a textual name that can be used to retrieve the component. Named service to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a textual name that can be used to retrieve the component. Named service to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a key that can be used to retrieve the component. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Provide a key that can be used to retrieve the component. Key to associate with the component. The service type provided by the component. A registration builder allowing further configuration of the component. Add a handler for the Preparing event. This event allows manipulating of the parameters that will be provided to the component. The event handler. A registration builder allowing further configuration of the component. Add a handler for the Activating event. The event handler. A registration builder allowing further configuration of the component. Add a handler for the Activated event. The event handler. A registration builder allowing further configuration of the component. Configure the component so that any properties whose types are registered in the container will be wired to instances of the appropriate service. Set wiring options such as circular dependency wiring support. A registration builder allowing further configuration of the component. Associates data with the component. Key by which the data can be located. The data value. A registration builder allowing further configuration of the component. Associates data with the component. The extended properties to associate with the component. A registration builder allowing further configuration of the component. Associates data with the component. A type with properties whose names correspond to the property names to configure. A registration builder allowing further configuration of the component. The activator data. The registration style. The registration data. Data common to all registrations made in the container, both direct (IComponentRegistration) and dynamic (IRegistrationSource.) Construct a RegistrationData instance. The default service that will be used if no others are added. Add multiple services for the registration, overriding the default. The services to add. If an empty collection is specified, this will still clear the default service. Add a service to the registration, overriding the default. The service to add. Copies the contents of another RegistrationData object into this one. The data to copy. When true, the default service will be changed to that of the other. Thrown if is . Empties the configured services. The services explicitly assigned to the component. The instance ownership assigned to the component. The lifetime assigned to the component. The sharing mode assigned to the component. Extended properties assigned to the component. Handlers for the Preparing event. Handlers for the Activating event. Handlers for the Activated event. Adds registration syntax to the type. Add a component to the container. The builder to register the component with. The component to add. Add a registration source to the container. The builder to register the registration source via. The registration source to add. Register an instance as a component. The type of the instance. Container builder. The instance to register. Registration builder allowing the registration to be configured. If no services are explicitly specified for the instance, the static type will be used as the default service (i.e. *not* instance.GetType()). Register a component to be created through reflection. The type of the component implementation. Container builder. Registration builder allowing the registration to be configured. Register a component to be created through reflection. The type of the component implementation. Container builder. Registration builder allowing the registration to be configured. Register a delegate as a component. The type of the instance. Container builder. The delegate to register. Registration builder allowing the registration to be configured. Register a delegate as a component. The type of the instance. Container builder. The delegate to register. Registration builder allowing the registration to be configured. Register an un-parameterised generic type, e.g. Repository<>. Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>(). Container builder. The open generic implementation type. Registration builder allowing the registration to be configured. Specifies that the component being registered should only be made the default for services that have not already been registered. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specifies that the components being registered should only be made the default for services that have not already been registered. Registration limit type. Registration style. Registration to set service mapping on. Registration builder allowing the registration to be configured. Register the types in an assembly. Container builder. The assemblies from which to register types. Registration builder allowing the registration to be configured. Register the types in a list. Container builder. The types to register. Registration builder allowing the registration to be configured. Specifies a subset of types to register from a scanned assembly. Registration limit type. Registration style. Activator data type. Registration to filter types from. Predicate that returns true for types to register. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Function mapping types to services. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Function mapping types to services. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Function mapping types to services. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Function mapping types to services. Registration builder allowing the registration to be configured. Specifies that a type from a scanned assembly provides its own concrete type as a service. Registration limit type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specifies that a type provides its own concrete type as a service. Registration limit type. Activator data type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specifies that a type provides its own concrete type as a service. Registration limit type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specify how a type from a scanned assembly provides metadata. Registration limit type. Registration style. Activator data type. Registration to set metadata on. A function mapping the type to a list of metadata items. Registration builder allowing the registration to be configured. Use the properties of an attribute (or interface implemented by an attribute) on the scanned type to provide metadata values. Inherited attributes are supported; however, there must be at most one matching attribute in the inheritance chain. The attribute applied to the scanned type. Registration to set metadata on. Registration builder allowing the registration to be configured. Specify how a type from a scanned assembly provides metadata. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Key of the metadata item. A function retrieving the value of the item from the component type. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a named service. Registration to set service mapping on. Service type provided by the component. Function mapping types to service names. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a named service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Service type provided by the component. Function mapping types to service names. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a keyed service. Registration to set service mapping on. Service type provided by the component. Function mapping types to service keys. Registration builder allowing the registration to be configured. Specifies how a type from a scanned assembly is mapped to a keyed service. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. Service type provided by the component. Function mapping types to service keys. Registration builder allowing the registration to be configured. Specifies that a type from a scanned assembly is registered as providing all of its implemented interfaces. Registration limit type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specifies that a type is registered as providing all of its implemented interfaces. Registration limit type. Activator data type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Specifies that a type is registered as providing all of its implemented interfaces. Registration limit type. Registration to set service mapping on. Registration builder allowing the registration to be configured. Set the policy used to find candidate constructors on the implementation type. Registration limit type. Activator data type. Registration style. Registration to set policy on. Policy to be used when searching for constructors. A registration builder allowing further configuration of the component. Set the policy used to find candidate constructors on the implementation type. Registration limit type. Activator data type. Registration style. Registration to set policy on. A function that returns the constructors to select from. A registration builder allowing further configuration of the component. Set the policy used to select from available constructors on the implementation type. Registration limit type. Activator data type. Registration style. Registration to set policy on. Constructor signature to match. A registration builder allowing further configuration of the component. Set the policy used to select from available constructors on the implementation type. Registration limit type. Registration style. Activator data type. Registration to set policy on. Policy to be used when selecting a constructor. A registration builder allowing further configuration of the component. Set the policy used to select from available constructors on the implementation type. Registration limit type. Activator data type. Registration style. Registration to set policy on. Expression demonstrating how the constructor is called. A registration builder allowing further configuration of the component. Configure an explicit value for a constructor parameter. Registration limit type. Registration style. Activator data type. Registration to set parameter on. Name of a constructor parameter on the target type. Value to supply to the parameter. A registration builder allowing further configuration of the component. Configure an explicit value for a constructor parameter. Registration limit type. Registration style. Activator data type. Registration to set parameter on. The parameter to supply to the constructor. A registration builder allowing further configuration of the component. Configure an explicit value for a constructor parameter. Registration limit type. Registration style. Activator data type. Registration to set parameter on. A predicate selecting the parameter to set. A registration builder allowing further configuration of the component. Configure explicit values for constructor parameters. Registration limit type. Registration style. Activator data type. Registration to set parameter on. The parameters to supply to the constructor. A registration builder allowing further configuration of the component. Configure an explicit value for a property. Registration limit type. Registration style. Activator data type. Registration to set property on. Name of a property on the target type. Value to supply to the property. A registration builder allowing further configuration of the component. Configure an explicit value for a property. Registration limit type. Registration style. Activator data type. Registration to set parameter on. The property to supply. A registration builder allowing further configuration of the component. Configure explicit values for properties. Registration limit type. Registration style. Activator data type. Registration to set parameter on. The properties to supply. A registration builder allowing further configuration of the component. Sets the target of the registration (used for metadata generation.) The type of the limit. The type of the activator data. Registration style Registration to set target for. The target. Registration builder allowing the registration to be configured. Thrown if or is . Provide a handler to be called when the component is registered. Registration limit type. Registration style. Activator data type. Registration add handler to. The handler. Registration builder allowing the registration to be configured. Provide a handler to be called when the component is registred. Registration limit type. Registration style. Registration add handler to. The handler. Registration builder allowing the registration to be configured. Specifies that a type from a scanned assembly is registered if it implements an interface that closes the provided open generic interface type. Registration limit type. Registration style. Activator data type. Registration to set service mapping on. The open generic interface or base class type for which implementations will be found. Registration builder allowing the registration to be configured. Filters the scanned types to include only those assignable to the provided type. Registration limit type. Registration style. Activator data type. Registration to filter types from. The type or interface which all classes must be assignable from. Registration builder allowing the registration to be configured. Filters the scanned types to include only those assignable to the provided type. Registration to filter types from. The type or interface which all classes must be assignable from. Registration builder allowing the registration to be configured. Filters the scanned types to exclude the provided type. Registration to filter types from. The concrete type to exclude. Registration builder allowing the registration to be configured. Filters the scanned types to exclude the provided type, providing specific configuration for the excluded type. Registration to filter types from. Registration for the excepted type. The concrete type to exclude. Registration builder allowing the registration to be configured. Filters the scanned types to include only those in the namespace of the provided type or one of its sub-namespaces. Registration to filter types from. A type in the target namespace. Registration builder allowing the registration to be configured. Filters the scanned types to include only those in the provided namespace or one of its sub-namespaces. Registration limit type. Registration style. Activator data type. Registration to filter types from. The namespace from which types will be selected. Registration builder allowing the registration to be configured. Adapt all components implementing service to provide using the provided function. Service type to adapt from. Service type to adapt to. Must not be the same as . Container builder. Function adapting to service , given the context and parameters. Adapt all components implementing service to provide using the provided function. Service type to adapt from. Service type to adapt to. Must not be the same as . Container builder. Function adapting to service , given the context. Adapt all components implementing service to provide using the provided function. Service type to adapt from. Service type to adapt to. Must not be the same as . Container builder. Function adapting to service . Decorate all components implementing open generic service . The and parameters must be different values. Container builder. Service type being decorated. Must be an open generic type. Service key or name associated with the components being decorated. Service key or name given to the decorated components. The type of the decorator. Must be an open generic type, and accept a parameter of type , which will be set to the instance being decorated. Decorate all components implementing service using the provided function. The and parameters must be different values. Service type being decorated. Container builder. Function decorating a component instance that provides , given the context and parameters. Service key or name associated with the components being decorated. Service key or name given to the decorated components. Decorate all components implementing service using the provided function. The and parameters must be different values. Service type being decorated. Container builder. Function decorating a component instance that provides , given the context. Service key or name associated with the components being decorated. Service key or name given to the decorated components. Decorate all components implementing service using the provided function. The and parameters must be different values. Service type being decorated. Container builder. Function decorating a component instance that provides . Service key or name associated with the components being decorated. Service key or name given to the decorated components. Run a supplied action instead of disposing instances when they're no longer required. Registration limit type. Activator data type. Registration style. Registration to set release action for. An action to perform instead of disposing the instance. Registration builder allowing the registration to be configured. Only one release action can be configured per registration. Wraps a registration in an implicit and automatically activates the registration after the container is built. Registration to set release action for. Registration limit type. Activator data type. Registration style. A registration builder allowing further configuration of the component. While you can implement an to perform some logic at container build time, sometimes you need to just activate a registered component and that's it. This extension allows you to automatically activate a registration on container build. No additional logic is executed and the resolved instance is not held so container disposal will end up disposing of the instance. Depending on how you register the lifetime of the component, you may get an exception when you build the container - components that are scoped to specific lifetimes (like ASP.NET components scoped to a request lifetime) will fail to resolve because the appropriate lifetime is not available. Share one instance of the component within the context of a single web/HTTP/API request. Only available for integration that supports per-request dependencies (e.g., MVC, Web API, web forms, etc.). Registration limit type. Registration style. Activator data type. The registration to configure. Additional tags applied for matching lifetime scopes. A registration builder allowing further configuration of the component. Thrown if is . A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The instance registration '{0}' can support SingleInstance() sharing only.. Looks up a localized string similar to A metadata attribute of type {0} was not found on {1}.. Looks up a localized string similar to More than one metadata attribute of type {0} was found on {1}.. Looks up a localized string similar to No matching constructor exists on type '{0}'.. An activator builder with no parameters. Return the provided activator. The activator to return. Gets the activator. Registration style for individual components. The id used for the registration. Handlers to notify of the component registration event. By default, new registrations override existing registrations as defaults. If set to true, new registrations will not change existing defaults. The component upon which this registration is based. Used to build an from component registrations. var builder = new ContainerBuilder(); builder.RegisterType<Logger>() .As<ILogger>() .SingleInstance(); builder.Register(c => new MessageHandler(c.Resolve<ILogger>())); var container = builder.Build(); // resolve components from container... Most functionality is accessed via extension methods in . Register a callback that will be invoked when the container is configured. This is primarily for extending the builder syntax. Callback to execute. Create a new container with the component registrations that have been made. Options that influence the way the container is initialised. Build can only be called once per - this prevents ownership issues for provided instances. Build enables support for the relationship types that come with Autofac (e.g. Func, Owned, Meta, Lazy, IEnumerable.) To exclude support for these types, first create the container, then call Update() on the builder. A new container with the configured component registrations. Configure an existing container with the component registrations that have been made. Update can only be called once per - this prevents ownership issues for provided instances. An existing container to make the registrations in. Configure an existing container with the component registrations that have been made and allows additional build options to be specified. Update can only be called once per - this prevents ownership issues for provided instances. An existing container to make the registrations in. Options that influence the way the container is updated. Configure an existing registry with the component registrations that have been made. Update can only be called once per - this prevents ownership issues for provided instances. An existing registry to make the registrations in. A parameter identified by name. When applied to a reflection-based component, will be matched against the name of the component's constructor arguments. When applied to a delegate-based component, the parameter can be accessed using . Component with parameter: public class MyComponent { public MyComponent(int amount) { ... } } Providing the parameter: var builder = new ContainerBuilder(); builder.RegisterType<MyComponent>(); var container = builder.Build(); var myComponent = container.Resolve<MyComponent>(new NamedParameter("amount", 123)); Create a with the specified constant value. The name of the parameter. The parameter value. The name of the parameter. Extension methods that simplify extraction of parameter values from an where T is . Each method returns the first matching parameter value, or throws an exception if none is provided. At configuration time, delegate registrations can retrieve parameter values using the methods , and : builder.Register((c, p) => new FtpClient(p.Named<string>("server"))); These parameters can be provided at resolution time: container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com")); Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories. Retrieve a named parameter value from a instance. The type to which the returned value will be cast. The available parameters to choose from. The name of the parameter to select. The value of the selected parameter. Retrieve a positional parameter value from a instance. The type to which the returned value will be cast. The available parameters to choose from. The zero-based position of the parameter to select. The value of the selected parameter. The position value is the one associated with the parameter when it was constructed, not its index into the sequence. Retrieve a typed parameter value from a instance. The type to which the returned value will be cast. The available parameters to choose from. The value of the selected parameter. A parameter that is identified according to an integer representing its position in an argument list. When applied to a reflection-based component, will be matched against the indices of the component's constructor arguments. When applied to a delegate-based component, the parameter can be accessed using . Component with parameter: public class MyComponent { public MyComponent(int amount) { ... } } Providing the parameter: var builder = new ContainerBuilder(); builder.RegisterType<MyComponent>(); var container = builder.Build(); var myComponent = container.Resolve<MyComponent>(new PositionalParameter(0, 123)); Construct a positional parameter with the specified constant value. The zero-based position of the parameter. The parameter value. The zero-based position of the parameter. Adds syntactic convenience methods to the interface. Set any properties on that can be resolved in the context. Type of instance. Used only to provide method chaining. The context from which to resolve the service. The instance to inject properties into. . Set any null-valued properties on that can be resolved by the container. Type of instance. Used only to provide method chaining. The context from which to resolve the service. The instance to inject properties into. . Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Name of the service. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Name of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Name of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Key of the service. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Key of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Key of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The service to retrieve. The context from which to resolve the service. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Parameters for the service. The component instance that provides the service. Retrieve a service from the context. The type to which the result will be cast. The context from which to resolve the service. Parameters for the service. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. The service type. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service type. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service type. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. The service name. Type of the service. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service name. Type of the service. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service name. Type of the service. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Key of the service. Type of the service. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Key of the service. Type of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Key of the service. Type of the service. The parameters. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. The service to resolve. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service to resolve. The component instance that provides the service. Retrieve a service from the context. The context from which to resolve the service. Parameters for the service. The service to resolve. The component instance that provides the service. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The name of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The name of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The name of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The name of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The name of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The key of the service. The service to resolve. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The type of the service. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The type of the service. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. Parameters for the service. The type of the service. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The service. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The service. Parameters for the service. The component instance that provides the service, or null. Retrieve a service from the context, or null if the service is not registered. The context from which to resolve the service. The service. Parameters for the service. The component instance that provides the service, or null. Determine whether the specified service is available in the context. The context from which to resolve the service. The service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The name of the service to test for the registration of. Type type of the service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The name of the service to test for the registration of. Type type of the service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The key of the service to test for the registration of. Type type of the service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The key of the service to test for the registration of. Type type of the service to test for the registration of. True if the service is registered. Determine whether the specified service is available in the context. The context from which to resolve the service. The service to test for the registration of. True if the service is registered. Try to retrieve a service from the context. The context from which to resolve the service. The service to resolve. The resulting component instance providing the service, or null. The parameters. True if a component providing the service is available. Thrown if is . Try to retrieve a service from the context. The context from which to resolve the service. The service to resolve. The resulting component instance providing the service, or null. True if a component providing the service is available. Try to retrieve a service from the context. The context from which to resolve the service. The service type to resolve. The resulting component instance providing the service, or null. True if a component providing the service is available. Try to retrieve a service from the context. The service type to resolve. The context from which to resolve the service. The resulting component instance providing the service, or default(T). True if a component providing the service is available. Try to retrieve a service from the context. The context from which to resolve the service. The name of the service to resolve. The type of the service to resolve. The resulting component instance providing the service, or null. True if a component providing the service is available. Try to retrieve a service from the context. The context from which to resolve the service. The key of the service to resolve. The type of the service to resolve. The resulting component instance providing the service, or null. True if a component providing the service is available. Flexible parameter type allows arbitrary values to be retrieved from the resolution context. Create an instance of the ResolvedParameter class. A predicate that determines which parameters on a constructor will be supplied by this instance. A function that supplies the parameter value given the context. Returns true if the parameter is able to provide a value to a particular site. Constructor, method, or property-mutator parameter. The component context in which the value is being provided. If the result is true, the valueProvider parameter will be set to a function that will lazily retrieve the parameter value. If the result is false, will be set to null. True if a value can be supplied; otherwise, false. Construct a that will match parameters of type and resolve for those parameters an implementation registered with the name . The type of the parameter to match. The name of the matching service to resolve. A configured instance. Construct a that will match parameters of type and resolve for those parameters an implementation registered with the key . The type of the parameter to match. The key of the matching service to resolve. A configured instance. A parameter that can supply values to sites that exactly match a specified type. When applied to a reflection-based component, will be matched against the types of the component's constructor arguments. When applied to a delegate-based component, the parameter can be accessed using . Component with parameter: public class MyComponent { public MyComponent(int amount) { ... } } Providing the parameter: var builder = new ContainerBuilder(); builder.RegisterType<MyComponent>(); var container = builder.Build(); var myComponent = container.Resolve<MyComponent>(new TypedParameter(typeof(int), 123)); Create a typed parameter with the specified constant value. The exact type to match. The parameter value. Shortcut for creating by using the type to be used for the parameter The parameter value. new typed parameter The type against which targets are matched. Extends with methods that are useful in building scanning rules for . Returns true if this type is in the namespace or one of its sub-namespaces. The type to test. The namespace to test. True if this type is in the namespace or one of its sub-namespaces; otherwise, false. Returns true if this type is in the same namespace as or one of its sub-namespaces. The type to test. True if this type is in the same namespace as or one of its sub-namespaces; otherwise, false. Determines whether the candidate type supports any base or interface that closes the provided generic type. Determines whether this type is assignable to . The type to test assignability to. True if this type is assignable to references of type ; otherwise, False. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The type '{0}' is not an open generic class or interface type.. Extension methods for . Safely returns the set of loadable types from an assembly. The from which to load types. The set of types from the , or the subset of types that could be loaded if there was any error. Thrown if is . Helper methods used throughout the codebase. Enforce that an argument is not null. Returns the value if valid so that it can be used inline in base initialiser syntax. Enforce that sequence does not contain null. Returns the value if valid so that it can be used inline in base initialiser syntax. The value. The name. Enforces that the provided object is non-null. The value. Enforce that an argument is not null or empty. Returns the value if valid so that it can be used inline in base initialiser syntax. The value. The description. Enforce that the argument is a delegate type. The type to test. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The argument '{0}' cannot be empty.. Looks up a localized string similar to The object of type '{0}' cannot be null.. Looks up a localized string similar to Type {0} returns void.. Looks up a localized string similar to The sequence provided as argument '{0}' cannot contain null elements.. Looks up a localized string similar to Type {0} is not a delegate type.. Extension methods for reflection-related types. Maps from a property-set-value parameter to the declaring property. Parameter to the property setter. The property info on which the setter is specified. True if the parameter is a property setter. Get a PropertyInfo object from an expression of the form x => x.P. Type declaring the property. The type of the property. Expression mapping an instance of the declaring type to the property value. Property info. Get the MethodInfo for a method called in the expression. Type on which the method is called. Expression demonstrating how the method appears. The method info for the called method. Gets the for the new operation called in the expression. The type on which the constructor is called. Expression demonstrating how the constructor is called. The for the called constructor. Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. The type of attribute to search for. The member to inspect. true to inspect the ancestors of element; otherwise, false. A custom attribute that matches , or null if no such attribute is found. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The provided expression must be of the form () =>new X(), but the provided expression was {0}.. Looks up a localized string similar to The provided expression must be of the form x =>x.M(), but the provided expression was {0}.. Looks up a localized string similar to The provided expression must be of the form x =>x.P, but the provided expression was {0}.. Adapts an action to the interface. Joins the strings into one single string interspersing the elements with the separator (a-la System.String.Join()). The elements. The separator. The joined string. Appends the item to the specified sequence. The sequence. The trailing item. Prepends the item to the specified sequence. The sequence. The leading item. Returns the first concrete interface supported by the candidate type that closes the provided open generic service type. The type that is being checked for the interface. The open generic type to locate. The type of the interface. Looks for an interface on the candidate type that closes the provided open generic interface type. The type that is being checked for the interface. The open generic service type to locate. True if a closed implementation was found; otherwise false. Retrieve registrations for an unregistered service, to be used by the container. The service that was requested. A function that will return existing registrations for a service. Registrations providing the service. Signal attribute for static analysis that indicates a helper method is validating arguments for . A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Unable to generate a function to return type '{0}' with input parameter types [{1}]. The input parameter type list has duplicate types. Try registering a custom delegate type instead of using a generic Func relationship.. Looks up a localized string similar to Delegate Support (Func<T>and Custom Delegates).