Autofac
Extension methods for
Builds the specified registration into the container,
simplifying addition of simple registrations to the container.
The container.
The registration.
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 resolved in
order to create the products of the factory.
The factory delegate type.
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.
Extends ContainerBuilder with methods for registering generated factories.
This file is excluded from the .NET 2.0 build.
Registers the factory delegate.
The container builder.
The type of the delegate.
The service that the delegate will return instances of.
A registrar allowing configuration to continue.
Registers the factory delegate.
The container builder.
The type of the delegate.
A registrar allowing configuration to continue.
Registers the factory delegate.
The container builder.
The type of the delegate.
The service that the delegate will return instances of.
A registrar allowing configuration to continue.
Registers the factory delegate.
The container builder.
The type of the delegate.
A registrar allowing configuration to continue.
Fired when the activation process for a new instance is complete.
Initializes a new instance of the class.
The context.
The component.
The instance.
The context in which the activation occurred.
The component providing the instance.
The instance that will be used to satisfy the request.
Fired during the activation process to allow instances to be proxied or swapped.
Initializes a new instance of the class.
The context.
The component.
The instance.
The context in which the activation is occurring.
The component providing the instance being activated.
The instance that will be used to satisfy the request (may be substituted.)
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.
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.
Helper method for parameters that allow type conversion.
The parameter.
The value.
A representation of the value able to be supplied for the parameter.
Executes the ConstructorInfo directly.
Invokes the specified constructor (or an equivalent.)
Invokes the constructor.
The context.
The parameters.
The selected constructor.
Arguments appropriate to the constructor.
The new instance.
Invokes the constructor.
The context.
The parameters.
The selected constructor.
Arguments appropriate to the constructor.
The new instance.
Describes a component and its services.
Captures the elements of a component registration that are shared between
all contexts in which the component can be used.
The services (named and typed) exposed by the component.
A unique identifier for this component (shared in all sub-contexts.)
This value also appears in Services.
Additional data associated with the component.
Note, component registrations are currently copied into
subcontainers: these properties are shared between all instances of the
registration in all subcontainers.
Returns the most specific type that the returned intstances are assignable to.
This may be the actual implementation type, a base class, and abstract class, or an
interface.
For registrations where the type is an interface or abstract class
it is recommended that the returned instances are inspected as they are activated.
The best known implementation type.
Initializes a new instance of the class.
The id. Will be exposed as a service.
The services. May or may not contain the id.
Most specific type that can be
determined as the implementation.
Initializes a new instance of the class.
The id. Will be exposed as a service.
The services. May or may not contain the id.
The extended properties.
Most specific type that can be
determined as the implementation.
Returns a that represents the current .
A that represents the current .
The services (named and typed) exposed by the component.
A unique identifier for this component (shared in all sub-contexts.)
This value also appears in Services.
Additional data associated with the component.
Note, component registrations are currently copied into
subcontainers: these properties are shared between all instances of the
registration in all subcontainers.
Returns the most specific type that the returned intstances are assignable to.
This may be the actual implementation type, a base class, and abstract class, or an
interface.
For registrations where the type is an interface or abstract class
it is recommended that the returned instances are inspected as they are activated.
The best known implementation 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 The value 'null' is cannot be registered as a valid service..
Looks up a localized string similar to Implementor = {0}, Services = [{1}].
Looks up a localized string similar to Unknown.
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 Singleton.
Implemented on registrations that decorate other registrations, providing the
decorated instance in a non-generic manner to improve API usability.
The decorated instance.
Exposes a tag value.
Gets the tag applied to the object.
The tag.
Element describing a component property.
Gets the name of the property.
The name.
Gets the value to be set (will be converted.)
The value.
Gets the type of the value.
The type of the value. Defaults to string if not specified.
Collection of extended property elements.
Base for multi-valued configuration elements.
Initializes a new instance of the class.
Name of the element.
The element key.
Indicates whether the specified exists in the .
The name of the element to verify.
true if the element exists in the collection; otherwise, false. The default is false.
Creates a new .
A new .
Gets the element key for a specified configuration element when overridden in a derived class.
The to return the key for.
An that acts as the key for the specified .
Returns an enumerator that iterates through the collection.
A that can be used to iterate through the collection.
Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class.
The name of the collection; otherwise, an empty string. The default is an empty string.
Gets the type of the .
The of this collection.
Gets or sets the TElementType at the specified index.
Initializes a new instance of the class.
Element describing an additional configuration file.
Gets the filename of the file.
The filename.
Gets the section name of the section in the configuration
file.
The section name.
A collection of file elements.
Initializes a new instance of the class.
Allows registrations to be made on-the-fly when unregistered
services are requested (lazy registrations.)
Retrieve a registration for an unregistered service, to be used
by the container.
The service that was requested.
A registration providing the service.
True if the registration could be created.
Configures the container so that requests for IEnumerable{T} or T[]
will result in all of the available instances of T being returned.
Represents a set of components and related functionality
packaged together.
Apply the module to the container.
Container to apply configuration to.
Configures the container.
Container to configure.
Injects into properties according to their name.
Needs to be reviewed - not sure if it makes sense to
have properties and parameters related this way.
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.
Create a named parameter with the specified value.
The name of the parameter.
The parameter value.
The name of the parameter.
A parameter identified according to its name within an argument list declaration.
Create a named parameter with the specified value.
The name of the parameter.
The parameter value.
The name of the parameter.
Extension methods that ease the extraction of particluar kinds of parameter values from
an enumerable sequence of the Parameter abstract type.
Each method returns the first matching parameter value, or throws an exception if
none is provided.
Retrieve a 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 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.
Retrieve a 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.
Construct a positional parameter with the specified value.
The zero-based position of the parameter.
The parameter value.
The zero-based position of the parameter.
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.
An instance can be supplied in order to avoid using the regular activator.
The parameters supplied to the activator.
Automatically registers types that match a supplied predicate.
Base class for component registrars.
Provides an interface through which a component registration can
be incrementally built. Calling any of the methods on this interface
after 'Build' has been called on the parent ContainerBuilder will have
no effect.
Self-type.
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.
Change the service associated with the registration.
The service that the registration will expose.
A registrar allowing registration to continue.
Change the services associated with the registration.
The first service that the registration will expose.
The second service that the registration will expose.
A registrar allowing registration to continue.
Change the services associated with the registration.
The first service that the registration will expose.
The second service that the registration will expose.
The third service that the registration will expose.
A registrar allowing registration to continue.
Change the service associated with the registration.
The services that the registration will expose.
A registrar allowing registration to continue.
Change the ownership model associated with the registration.
This determines when the instances are disposed and by whom.
The ownership model to use.
A registrar allowing registration to continue.
The instance(s) will not be disposed when the container is disposed.
The instance(s) will be disposed with the container.
Change the scope associated with the registration.
This determines how instances are tracked and shared.
The scope model to use.
A registrar allowing registration to continue.
An instance will be created every time one is requested.
An instance will be created once per container.
Only one instance will ever be created.
Calls the provided handler when the registration is made on the
container being built.
The handler.
A registrar allowing registration to continue.
Call the provided handler when preparing to activate an instance. OnPreparing
is the place to interrupt of modify the parameters to the activation process.
The handler.
A registrar allowing registration to continue.
Call the provided handler when activating an instance. OnActivating
is the place to do work to get an instance into a usable state.
The handler.
A registrar allowing registration to continue.
Call the provided handler when an instance is activated. This is the
place to perform operations on the activated instance that will use that
instance's behaviour/features.
The handler.
A registrar allowing registration to continue.
Associates an extended property with the registration.
The key.
The value.
A registrar allowing registration to continue.
Sets the component to be resolvable only in contexts tagged with the
provided tag. Implies that the component is container-scoped, however factory-scoped can be
specified explicitly.
The type of the tag.
The tag.
A registrar allowing registration to continue.
Applies the registration only if the supplied predicate is true at the time
the container is built. If applied multiple times, predicates are composed
with the 'and' operator.
Predicate based on a container.
A registrar allowing registration to continue.
Gets or sets the registration creator.
The registration creator.
Apply the module to the container. Subclasses should implement DoConfigure() rather than
overriding this member.
Container to apply configuration to.
Apply the module to the container.
Container to apply configuration to.
Change the service associated with the registration.
The service that the registration will expose.
A registrar allowing registration to continue.
Change the services associated with the registration.
The first service that the registration will expose.
The second service that the registration will expose.
A registrar allowing registration to continue.
Change the services associated with the registration.
The first service that the registration will expose.
The second service that the registration will expose.
The third service that the registration will expose.
A registrar allowing registration to continue.
Change the service associated with the registration.
The services that the registration will expose.
A registrar allowing registration to continue.
Change the ownership model associated with the registration.
This determines when the instances are disposed and by whom.
The ownership model to use.
A registrar allowing registration to continue.
The instance(s) will not be disposed when the container is disposed.
The instance(s) will be disposed with the container.
Change the scope associated with the registration.
This determines how instances are tracked and shared.
The scope model to use.
A registrar allowing registration to continue.
An instance will be created every time one is requested.
An instance will be created once per container.
Only one instance will ever be created.
Call the provided handler when activating an instance.
The handler.
A registrar allowing registration to continue.
Call the provided handler when preparing to activate an instance. OnPreparing
is the place to interrupt of modify the parameters to the activation process.
The handler.
A registrar allowing registration to continue.
Call the provided handler when activating an instance.
The handler.
A registrar allowing registration to continue.
Call the provided handler when an instance is activated.
The handler.
A registrar allowing registration to continue.
Associates an extended property with the registration. The property must not
already exist.
The key.
The value.
A registrar allowing registration to continue.
Sets the component to be resolvable only in contexts tagged with the
provided tag. Implies that the component is container-scoped, however factory-scoped can be
specified explicitly.
The type of the tag.
The tag.
A registrar allowing registration to continue.
Applies the registration only if the supplied predicate is true at the time
the container is built. If applied multiple times, predicates are composed
with the 'and' operator.
Predicate based on a container.
A registrar allowing registration to continue.
Add a service to be exposed by the component.
The service to add.
Add many services to be exposed by the component.
The services to add (by calling AddService().)
Fires the registered event.
The instance containing the event data.
Sets up the registration with events, registers it in the container, and fires
the Registered event.
The container.
The cr.
Base class for component registrars.
Returns this instance, correctly-typed.
Gets or sets the registration creator.
The registration creator.
The services exposed by this registration.
The instance scope used by this registration.
The instance ownership used by this registration.
The handlers for the Preparing event used by this registration.
The handlers for the Activating event used by this registration.
The handlers for the Activated event used by this registration.
Gets the extended properties.
The extended properties.
Provides builder syntax for generic registrations.
Enforce that the specific constructor with the provided signature is used.
The types that designate the constructor to use.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Initializes a new instance of the class.
The predicate.
Registers the component.
The container.
Enforce that the specific constructor with the provided signature is used.
The types that designate the constructor to use.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Returns this instance, correctly-typed.
Utilities to handle common activation scenarios
Inject properties from the context into the newly
activated instance.
The sender.
The instance containing the event data.
Inject properties from the context into the newly
activated instance unless they're non null on the instance.
The sender.
The instance containing the event data.
Utilities to handle common activation scenarios
Inject properties from the context into the newly
activated instance.
The sender.
The instance containing the event data.
Inject properties from the context into the newly
activated instance unless they're non null on the instance.
The sender.
The instance containing the event data.
Provides registrations based on a requested type.
This class provides a common base for registration handlers that provide
reflection-based registrations.
Initializes a new instance of the class.
The deferred params.
The constructor selector.
Additional arguments to supply to the component's constructor.
Additional properties to set on the component.
Retrieve a registration for an unregistered service, to be used
by the container.
The service that was requested.
A registration providing the service.
True if the registration could be created.
Determine if the service represents a type that can be registered, and if so,
retrieve that type as well as the services that the registration should expose.
The service.
The implementation type.
The services.
True if a registration can be made.
Initializes a new instance of the class.
The predicate.
The deferred registration params.
The constructor selector.
Additional arguments to supply to the component's constructor.
Additional properties to set on the component.
Determine if the service represents a type that can be registered, and if so,
retrieve that type as well as the services that the registration should expose.
The service.
The implementation type.
The services.
True if a registration can be made.
Register a component using a provided instance.
Registers a regular component.
A 'concrete' registrar creates IComponentRegistration
instances that are registered with the container. This is necessary because
some registration types (e.g. Generic) add registrations only on demand through
IRegistrationSource and thus do not have unique names within the container.
Associate a name with the registration.
A registrar allowing configuration to continue.
Associate services with the registration.
The services that the registration will expose.
A registrar allowing configuration to continue.
Filters the services exposed by the registration to include only those that are
not already registered. I.e., will not override existing registrations.
A registrar allowing registration to continue.
Adds the registration to a previously registered collection.
Name of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
Type of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
Type of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
The service.
A registrar allowing configuration to continue.
A unique service identifier that will be associated with the resulting
registration.
var builder = new ContainerBuilder();
var id = builder.Register(c => new Foo()).FactoryScoped().Id;
var container = builder.Build();
var myFoo = container.Resolve(id);
// container.Resolve<Foo>() will also work, but the id guarantees the specific registration
Initializes a new instance of the ComponentRegistrar<TComponent> class.
The implementation type.
Initializes a new instance of the ComponentRegistrar<TComponent> class.
The implementation type.
The default service.
Registers the component. If the component has not been assigned a name, explicit
services or a factory delegate, then it will be registered as providing its own type
as the default service.
The container.
Setst the name of the registration.
A registrar allowing configuration to continue.
Change the service associated with the registration.
The services that the registration will expose.
A registrar allowing registration to continue.
Add a service to be exposed by the component.
The service to add.
Creates the activator for the registration.
An activator.
Filters the services exposed by the registration to include only those that are
not already registered. I.e., will not override existing registrations.
A registrar allowing registration to continue.
Adds the registration to a previously registered collection.
Name of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
Type of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
Type of the service.
A registrar allowing configuration to continue.
Adds the registration to a previously registered collection.
The service.
A registrar allowing configuration to continue.
The services exposed by this registration.
A unique service identifier that will be associated with the resulting
registration.
Only created if accessed.
A 'concrete' registrar creates IComponentRegistration
instances that are registered with the container. This is necessary because
some registration types (e.g. Generic) add registrations only on demand through
IRegistrationSource and thus do not have unique names within the container.
Constructs a CollectionRegistrar.
Creates the activator for the registration.
An activator.
Returns this instance, correctly-typed.
Appends services to a service collection.
Create a new collection registration appender for the collection
identified by .
The collection.
Adds the registration to a previously registered collection.
The registrar's self-type.
The registrar that will become a member of the collection.
Custom activator that maintains a service list and returns instances
of List.
Provides a method by which new instances of a
component can be accessed.
Create a component instance, using container
to resolve the instance's dependencies.
The context to use
for dependency resolution.
Parameters that can be used in the resolution process.
A component instance. Note that while the
returned value need not be created on-the-spot, it must
not be returned more than once by consecutive calls. (Throw
an exception if this is attempted. IActivationScope should
manage singleton semantics.)
A 'new context' is a scope that is self-contained
and that can dispose the components it contains before the parent
container is disposed. If the activator is stateless it should return
true, otherwise false.
true if this instance can support a new context; otherwise, false.
Gets the implementation type.
Create a component instance, using container
to resolve the instance's dependencies.
The context to use
for dependency resolution.
Parameters that can be used in the resolution process.
A component instance. Note that while the
returned value need not be created on-the-spot, it must
not be returned more than once by consecutive calls. (Throw
an exception if this is attempted. IActivationScope should
manage singleton semantics.)
Gets the services that will appear in instances of the list.
The items.
Not supported as the ServiceListRegistration class overrides
DuplicateForNewContext to avoid this method call.
Parameters that allow a registration to be created at a later point when one
is required.
Initializes a new instance of the class.
The ownership.
The scope.
The preparing handlers.
The activating handlers.
The activated handlers.
The create registration.
Gets the ownership.
The ownership.
Gets the scope.
The scope.
Gets the activating handlers.
The handlers.
Gets the preparing handlers.
The handlers.
Gets the activated handlers.
The handlers.
Gets the registration creator.
The registration creator.
Implementations of the ComponentActivator type will
create an instance of a component, using the provided container
to resolve its dependencies.
The container from which the component's
dependencies may be resolved.
An instance of the component.
A creation delegate can be used when the method of initialisation
of a component is complex, its constructors require parameters
that must be obtained from outside the container.
The delegate should always return a unique instance.
Implementations of the ComponentActivator type will
create an instance of a component, using the provided container
to resolve its dependencies.
The container from which the component's
dependencies may be resolved.
The activation parameters.
An instance of the component.
A creation delegate can be used when the method of initialisation
of a component is complex, its constructors require parameters
that must be obtained from outside the container.
The delegate should always return a unique instance.
Creates generic component registrations that will be automatically bound to concrete
types as they are requested.
The interface of this class and returned IRegistrar are non-generic as
C# (or the CLR) does not allow partially-constructed generic types like IList<>
to be used as generic arguments.
Initializes a new instance of the class.
The implementor.
Registers the component.
The container.
Enforce that the specific constructor with the provided signature is used.
The types that designate the constructor to use.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Returns this instance, correctly-typed.
Adds methods to the IRegistrar interface to add additional
information for components created using reflection.
Enforce that the specific constructor with the provided signature is used.
The types that designate the constructor to use.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
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 Provided instances can only have singleton scope. WithScope() does not need to be called, but the default builder scope has to be singleton when the instance 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 The type '{0}' does not provide a constructor with signature '{1}'..
Fired when a registrar is applied to a container.
The container.
The registration being made. May be 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.
Create the registration.
The descriptor.
Activator.
Scope.
Ownership model.
The registration.
Registers an already-constructed component registration with the container.
Initializes a new instance of the class.
The registration.
Registers the component.
The container.
Exposed by the generic ServiceListRegistration type to expose non-generic Add().
Add a service (key into another component registration) to those returned
in the list.
Registration that exposes collection interfaces onto a subset of other components
in the container.
Implements IComponentRegistration using activator and
scope 'policy' classes.
ComponentRegistration, IActivator, IScope etc. are not parameterised
with the component type because in some situations, i.e. when calling
remote services through a proxy, a component type may not be available.
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.
Checks that this instance has not been disposed.
Gets a value indicating whether this instance is disposed.
true if this instance is disposed; otherwise, false.
A component registration is used by the container
to create and manage the services it holds.
Must return a valid instance, or throw
an exception on failure.
The context that is to be used
to resolve the instance's dependencies.
Parameters that can be used in the resolution process.
The disposer.
if set to true a new instance was created.
A newly-resolved instance.
Create a duplicate of this instance if it is semantically valid to
copy it to a new context.
The duplicate.
True if the duplicate was created.
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 instance.
Describes the component registration and the
services it provides.
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.
Create a new ComponentRegistration.
The descriptor.
An object with which new component instances
can be created. Required.
An object that tracks created instances with
respect to their scope of usage, i.e., per-thread, per-call etc.
Required. Will be disposed when the registration is disposed.
The ownership model that determines
whether the instances are disposed along with the scope.
Must return a valid instance, or throw
an exception on failure.
The context that is to be used
to resolve the instance's dependencies.
Parameters that can be used in the resolution process.
The disposer.
if set to true a new instance was created.
A newly-resolved instance.
Create a duplicate of this instance if it is semantically valid to
copy it to a new context.
The duplicate.
True if the duplicate was created.
Semantically equivalent to ICloneable.Clone().
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 instance.
Returns a that represents the current .
A that represents the current .
Describes the component registration and the
services it provides.
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.
Gets the scope.
The scope.
Gets the activator.
The activator.
Gets the ownership model.
The ownership model.
Initializes a new instance of the class.
The descriptor.
The activator.
The scope.
Add a service (key into another component registration) to those returned
in the list.
Create a duplicate of this instance if it is semantically valid to
copy it to a new context.
The duplicate.
True if the duplicate was created.
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 a generic type..
Factory for IScope entities that extends the InstanceScope class.
Create an IScope corresponding to the provided enum value.
Enum value representing a scope.
An equivalent IScope.
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 provides scope '{0}' was not recognised..
Provides dependency resolution during a single resolve operation.
The context in which a service can be accessed or a component's
dependencies resolved. Disposal of a context will dispose any owned
components.
This interface is intended to be the lowest-common-denominator between
IoC containers - the Autofac-specific features are generally available
through the Container class only. By restricting wider application access
to this interface, an application can remain compatible with other
containers and be adapted to them via this interface if necessary.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The type to which the result will be cast.
Name of the service.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The name of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The key of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available.
Useful with the C#3 initialiser syntax.
container.Register<ISomething>(c => new Something(){ AProperty = c.ResolveOptional<IOptional>() });
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The type to which the result will be cast.
Name of the service.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The name of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The key of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available.
Useful with the C#3 initializer syntax.
container.Register<ISomething>(c => new Something(){ AProperty = c.ResolveOptional<IOptional>() });
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Set any properties on that can be
resolved by the container. (Generally use
unless you're using the Null Object pattern for unset dependencies.)
Type of instance. Used only to provide method chaining.
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 instance to inject properties into.
.
Catch circular dependencies that are triggered by post-resolve processing (e.g. 'OnActivated')
A context with no registered components.
For the duration of a single resolve operation, tracks the services
that have been requested.
Initializes a new instance of the class.
The container from which to draw component registrations.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The type to which the result will be cast.
Name of the service.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available.
Useful with the C#3 initialiser syntax.
container.Register<ISomething>(c => new Something(){ AProperty = c.ResolveOptional<IOptional>() });
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The name of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The key of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Set any null-valued properties on that can be
resolved by the container.
Type of instance. Used only to provide method chaining.
The instance to inject properties into.
.
Inspect all public writeable properties and inject
values from the container if available. For factory-lifecycle components
a speed improvement could be had here by caching the property-value
pairs.
Set any properties on that can be
resolved by the container. (Generally use
unless you're using the Null Object pattern for unset dependencies.)
Type of instance. Used only to provide method chaining.
The instance to inject properties into.
.
Set any properties on that can be
resolved by the container.
Type of instance. Used only to provide method chaining.
The instance to inject properties into.
If set to true any properties with existing
values will be overwritten.
.
Tracks activation events that need to be fired.
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}'.
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 required component could not be created..
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.
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.
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 Type {0} is not a delegate type..
An UndoAction cleans up when a guard is not dismissed (e.g. in the
event of an exception.)
A Guard stores a stack of s that it will execute
if it is disposed before it is dismissed.
var i = 2;
using (var guard = new Guard())
{
var oldI = i;
guard.Add(() => i = oldI);
i = 3;
// guard.Dismiss() should be called here
}
// i will be reset to 2 by the guard.
Create a guard with an empty undo stack.
Create a guard with an initial undo action.
The undo action.
Dismiss the guard, so that it can be disposed
without the undo actions being executed.
Add an action to the undo stack.
The action to perform in the event of an undo.
Dispose of managed and unmanaged resources.
If false, this object is being garbage collected.
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 guard has already been dismissed..
Provides the full Autofac container functionality.
It is recommended that in most instances the more limited IContext interface is
used instead, as this is easier to implement on top of a different back-end, e.g. a
customised or alternative container.
Begin a new sub-context. Contextual and transient instances created inside
the subcontext will be disposed along with it.
A new subcontext.
Register a component.
A component registration.
Add a source from which registrations may be retrieved in the case that they
are not available in the container.
The source.
Gets the default component registration that will be used to satisfy
requests for the provided service.
The service.
The registration.
True if a default exists, false otherwise.
Tags the container with the provided value.
The tag applied to this container and the contexts genrated when
it resolves component dependencies.
The disposer associated with this container. Instances can be associated
with it manually if required.
If the container is an inner container, retrieves the outer container.
Otherwise, null;
The registrations for all of the components registered with the container.
Fired whenever a component is registed into the container.
Allows registrations to be accessed by the resolve infrastructure.
Gets a registration from the container by key.
The key for the registration (name or generated service key.)
The registration result.
The disposer that should be used to dispose of instances activated by
the registration.
The context that should be used when activating
instances from the registration, or null if these instances can be
activated in the current context.
True if the registration exists.
Gets a registration from the specific outer container by key.
The key for the registration (name or generated service key.)
The registration result.
The disposer that should be used to dispose of instances activated by
the registration.
True if the registration exists.
Determines when instances supporting IDisposable are disposed.
The container/context does not dispose the instances.
The instances are disposed when the container/context is disposed.
Determines when instances are created and how they are shared.
Each request for an instance will return the same object, regardless
of any subcontexts created.
Each request for an instance in the same container will return the same object.
Each request for an instance will return a new object.
Used to incrementally build component registrations.
Set the default for new registrations. Registrations
already made will not be affected by changes in this value.
The new default ownership.
An object that when disposed, will restore the original default ownership.
Set the default for new registrations. Registrations
already made will not be affected by changes in this value.
An object that when disposed, will restore the original default scope.
Add a module to the container.
The module to add.
Register a component using a component registration.
Create a new container with the registrations that have been built so far.
Build can only be called once per ContainerBuilder - this prevents lifecycle
issues for provided instances.
A new container with the registrations made.
Configure an existing container with the registrations that have been built so far.
Build can only be called once per ContainerBuilder - this prevents lifecycle
issues for provided instances.
An existing container to make the registrations in.
Attach the registrar to the builder (register it as a module) and
set defaults as necessary.
Register an un-parameterised generic type, e.g. Repository<>
.
Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>()
.
The implementor.
A registrar allowing configuration to continue.
Register a component to be created through reflection.
The type of the component.
A registrar allowing details of the registration to be customised.
Register a component to be created through reflection.
The type of the component.
A registrar allowing details of the registration to be customised.
Registers the types matching.
The predicate.
A registrar allowing configuration to continue.
Registers the types from assembly.
The assembly.
A registrar allowing configuration to continue.
Registers the types assignable to.
A registrar allowing configuration to continue.
Registers the type as a collection. If no services or names are specified, the
default service will be IEnumerable<T>();
Collection item type
A registrar allowing configuration to continue.
Registers the type as a collection. If no services or names are specified, the
default service will be IEnumerable<T>();
Collection item type
A registrar allowing configuration to continue.
Register a component that will be created using a provided delegate.
The type of the component.
The creator.
A registrar allowing details of the registration to be customised.
Register a component that will be created using a provided delegate.
The type of the component.
The creator.
A registrar allowing details of the registration to be customised.
Register a component using a provided instance.
The type of the component.
The instance.
A registrar allowing details of the registration to be customised.
The default for new registrations.
The default for new registrations.
Register a component using a delegate.
Initializes a new instance of the DelegateRegistrar<TComponent> class.
The implementor.
The creator.
Creates the activator for the registration.
An activator.
Returns this instance, correctly-typed.
Register a component using a provided instance.
Initializes a new instance of the class.
The instance.
Initializes a new instance of the class.
The instance.
The default service.
Creates the activator for the registration.
An activator.
Change the scope associated with the registration.
This determines how instances are tracked and shared.
The scope model to use.
A registrar allowing registration to continue.
Resolves issue #7 - Provided instances not disposed unless they are resolved
first. Manually attaches instance to container's disposer if Container ownership
is chosen.
The container.
Returns this instance, correctly-typed.
Register a component to be created through reflection.
Initializes a new instance of the class.
The implementation type.
Enforce that the specific constructor with the provided signature is used.
The types that designate the constructor to use.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Associates constructor parameters with default values.
The named values to apply to the constructor.
These may be overriden by supplying any/all values to the IContext.Resolve() method.
A registrar allowing registration to continue.
Provide explicit property values to be set on the new object.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Provide explicit property values to be set on the new object.
A registrar allowing configuration to continue.
Note, supplying a null value will not prevent property injection if
property injection is done through an OnActivating handler.
Creates the activator for the registration.
An activator.
Returns this instance, correctly-typed.
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 component '{0}' does not support the service '{1}'..
This class, not yet part of the public API, provides a means
by which generic component registrations can be made.
This class creates registrations by handling the Container.ServiceNotRegistered
event. This feels hacky but keeps the container cleaner and simpler. Will have
to see how performance goes.
Initializes a new instance of the class.
The services.
The implementor.
The deferred params.
The constructor selector.
Additional arguments to supply to the component's constructor.
Additional properties to set on the component.
Determine if the service represents a type that can be registered, and if so,
retrieve that type as well as the services that the registration should expose.
The service.
The implementation type.
The services.
True if a registration can be made.
Element describing a module registration.
Gets the type of the module. Must expose .
The type.
Gets the parameters used to construct the component.
The parameters.
Gets the properties to be explicitly set on the component.
The explicit properties.
A collection of module elements.
Initializes a new instance of the class.
Base class for user-defined modules. Implements IModule on top
of ContainerBuilder.
Apply the module to the container.
Container to apply configuration to.
Override to add registrations to the container.
Note that the ContainerBuilder parameter is not the same one
that the module is being registered by (i.e. it can have its own defaults.)
The builder.
Attach the module to a registration either already existing in
or being registered in the container.
The container.
The registration.
Identifies a service using a textual name.
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 LHS.
The RHS.
The result of the operator.
Implements the operator !=.
The LHS.
The RHS.
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.
Initializes a new instance of the class.
Name of the service.
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 or sets the name of the service.
The name of the service.
Gets a human-readable description of the service.
The description.
Element describing a component registration.
Gets the type of the component.
The type.
Gets the service exposed by the component. For multiple-service components,
use the services element instead.
The service.
Allows the component to be added to another composite component.
The name of the composite component.
Allows the component to be added to another composite component.
The name of the composite component.
Sets the scope of the component instances.
singleton (default,) factory or container.
Sets the ownership over the component instances.
container (default) or external.
Sets up property injection for the component instances. This uses the
OnActivated event so that circular dependencies can be handled.
never (default,) all, unset.
Gets the services exposed by the component.
The services.
Gets the parameters used to construct the component.
The parameters.
Gets the properties to be explicitly set on the component.
The explicit properties.
Gets the extended properties associated with the registration.
The extended properties.
A collection of component elements.
Initializes a new instance of the class.
Configures containers based upon app.config settings.
The default section name that will be searched for.
Initializes a new instance of the class.
The reader will look for a 'autofac' section.
Initializes a new instance of the class.
Name of the configuration section.
The configuration file.
Initializes a new instance of the class.
Name of the configuration section.
Override to add registrations to the container.
The builder.
Sets the property injection mode for the component.
The component.
The registrar.
Sets the ownership model of the component.
The component.
The registrar.
Sets the scope model for the component.
The component.
The registrar.
Loads the type.
Name of the type.
The default assembly.
Gets the section handler.
The section handler.
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 configuration section '{0}' could not be read..
Looks up a localized string similar to The type '{0}' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly"..
Looks up a localized string similar to The value '{0}' is not valid for the inject-properties attribute. Valid values are 'never', 'all' and 'unset'..
Looks up a localized string similar to The value '{0}' is not valid for the ownership attribute. Valid values are 'container' and 'external'..
Looks up a localized string similar to The value '{0}' is not valid for the scope attribute. Valid values are 'singleton', 'factory' and 'container'..
Element describing a component constructor parameter.
Gets the name of the parameter.
The name.
Gets the value used to set the parameter (type will be converted.)
The value.
A collection of parameter elements.
Initializes a new instance of the class.
Convert to the Autofac parameter type.
The parameters represented by this collection.
Element describing a component property.
Gets the name of the property.
The name.
Gets the value to be set (will be converted.)
The value.
Collection of property elements.
Initializes a new instance of the class.
Convert to the Autofac parameter type.
The parameters represented by this collection.
Section handler for Autofac configuration in app.config files.
Gets the modules to be registered.
The modules.
Gets the components to be registered.
The components.
Gets additional configuration files.
The files.
Gets the default assembly to search for types in when not explicitly
provided with the type name.
The default assembly.
Element describing a service exposed by a component.
Gets the service type.
The type.
A collection of service elements.
Initializes a new instance of the class.
Standard container implementation.
Protects instance variables from concurrent access.
Associates each service with the default registration that
can provide that service.
Supports nested containers.
External registration sources.
Disposer that handles disposal of instances attached to the container.
When creating inner containers the construction of the descriptor was previously
the most expensive operation - using a shared descriptor eliminates this.
A container with no component registrations.
Initialises the class.
Create a new container.
Initializes a new instance of the class.
The outer scope.
Begin a new sub-context. Contextual and transient instances created inside
the subcontext will be disposed along with it.
A new subcontext.
Register a component.
A component registration.
Registers the component, restricting its provided services to 'specificService' in order
to protect pre-existing defaults if necessary.
The registration.
The specific service or null.
Add a source from which registrations may be retrieved in the case that they
are not available in the container.
Gets the default component registration that will be used to satisfy
requests for the provided service.
The service.
The registration.
True if a default exists, false otherwise.
Enables context tagging in the container.
The tag applied to this container and the contexts genrated when
it resolves component dependencies.
Gets a registration from the container by key.
The key for the registration (name or generated service key.)
The registration result.
The disposer that should be used to dispose of instances activated by
the registration.
The context that should be used when activating instances from the
registration.
This method has gotten a bit gnarly. It might help to replace the three 'out' parameters
with a single structure, though usage in Context doesn't really point that way.
Gets a registration from the specific outer container by key.
The key for the registration (name or generated service key.)
The registration result.
The disposer that should be used to dispose of instances activated by
the registration.
True if a registration is available.
Searches for an IRegistrationSource that can provide a registration for an
unregistered service, and completes the registration process if possible.
The requested service.
The registration for that service.
True if a registration was provided, otherwise, false.
Create an IComponentRegistration for a new subcontext if available.
The service that was requested. Note that any
additional services provided by the component will also be exported.
The new registration.
True if the new context could be supported.
Releases unmanaged and - optionally - managed resources
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Creates the context for a single resolve operation.
The context.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The type to which the result will be cast.
Name of the service.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service, or null if
none is available.
Useful with the C#3 initialiser syntax.
container.Register<ISomething>(c => new Something(){ AProperty = c.ResolveOptional<IOptional>() });
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Retrieve a service registered with the container
The type of the service to retrieve.
Name of the service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
Retrieve a service registered with the container.
The type to which the result will be cast.
Name of the service.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The name of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The key of the component to retrieve.
The component instance that provides the service.
The parameters.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The service to retrieve.
The parameters.
The component instance that provides the service, or null if
none is available.
Useful with the C#3 initialiser syntax.
container.Register<ISomething>(c => new Something(){ AProperty = c.ResolveOptional<IOptional>() });
Determines whether the specified service is registered.
The service.
true if the specified service is registered; otherwise, false.
Determines whether the specified service is registered.
The service.
true if the specified service is registered; otherwise, false.
Determines whether the specified service is registered.
The service.
true if the specified service is registered; otherwise, false.
Determine whether or not a service has been registered.
The service to test for the registration of.
True if the service is registered.
Set any properties on that can be
resolved by the container. (Generally use
unless you're using the Null Object pattern for unset dependencies.)
Type of instance. Used only to provide method chaining.
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 instance to inject properties into.
.
Retrieve a service registered with the container.
The name of the component to retrieve.
The component instance that provides the service.
True if the service was registered and its instance created;
false otherwise.
Retrieve a service registered with the container.
The key of the component to retrieve.
The component instance that provides the service.
True if the service was registered and its instance created;
false otherwise.
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.
If the container is an inner container, retrieves the outer container.
Otherwise, null;
The registrations for all of the components registered with the container.
Fired whenever a component is registed into the container.
Scope model tied to the lifetime of the container in which
the instance is resolved. This is useful for items whose lifespan
is a single web request, for instance.
Maintains an association between instances and
their activation scope. This can represent per-call,
global, thread-based, request-based or user-based scope etc.
It is an error to call
GetInstance() if there is no instance available. Likewise,
it is an error to call SetInstance() when an instance
already exists in the current scope.
An activation scope is also responsible for disposing
its managed instances when it is itself disposed.
Note that obviously an Instance property could be used
to mimic the same behaviour, however the semantics
would differ from that of a regular property.
The instance corresponding to this scope.
The instance.
There is not instance available.
Sets the instance to be associated with the
current activation scope.
The instance.
There is already an instance available.
Try to create a scope container for a new context.
The duplicate.
True if the semantics of the scope model allow for new contexts.
Returns true if there is already an instance available
in the current activation scope.
The instance corresponding to this scope.
The instance.
There is not instance available.
Sets the instance to be associated with the
current activation scope.
The instance.
There is already an instance available.
Try to create a scope container for a new context.
The duplicate.
True if the semantics of the scope model allow for new contexts.
Returns a that represents the current .
A that represents the current .
Returns true if there is already an instance available
in the current activation scope.
Manages instances in such a way that every activation gets
a new instance, i.e. the scope of an instance is a single activation.
This behaviour is consistent with factory semantics.
The instance corresponding to this scope.
The instance.
There is not instance available.
Sets the instance to be associated with the
current activation scope.
The instance.
There is already an instance available.
Try to create a scope container for a new context.
The duplicate.
True if the semantics of the scope model allow for new contexts.
Returns a that represents the current .
A that represents the current .
Returns true if there is already an instance available
in the current activation scope.
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 Factory.
Looks up a localized string similar to An instance is never available from a Factory activation scope. Check this condition with InstanceAvailable before calling GetInstance()..
Implementations of the ComponentCreationDelegate type will
create an instance of a component, using the provided container
to resolve its dependencies.
The container from which the component's
dependencies may be resolved.
Parameters that can be used in the resolution process.
An instance of the component.
A creation delegate can be used when the method of initialisation
of a component is complex, its constructors require parameters
that must be obtained from outside the container.
The delegate should always return a unique instance.
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}, Activator = {1}, Scope = {2}, Ownership = {3}.
A component activator that uses a lazily-evaluated
delegate/expression to create a component.
Create a DelegateActivator.
A creation delegate. Required.
Create a component instance, using container
to resolve the instance's dependencies.
The context to use
for dependency resolution.
Parameters that can be used in the resolution process.
A component instance. Note that while the
returned value need not be created on-the-spot, it must
not be returned more than once by consecutive calls. (Throw
an exception if this is attempted. IActivationScope should
manage singleton semantics.)
Returns a that represents the current .
A that represents the current .
A 'new context' is a scope that is self-contained
and that can dispose the components it contains before the parent
container is disposed. If the activator is stateless it should return
true, otherwise false.
true if this instance can support a new context; 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 creation delegate must not return null..
Looks up a localized string similar to An activator of type '{0}' does not support the service '{1}'..
Looks up a localized string similar to Delegate.
Problem resolving dependencies, e.g. circular references, no callable constructor etc.
Initializes a new instance of the class.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The message.
The inner exception.
Initializes a new instance of the class.
The that holds the serialized object data about the exception being thrown.
The that contains contextual information about the source or destination.
The parameter is null.
The class name is null or is zero (0).
Used to determine which constructor will be used by the ReflectionComponentActivator
when more than one matching constructor is found.
Returns the most suitable constructor from those provided.
Required. Must contain at least one item.
The most suitable 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 service is required per component registration..
Looks up a localized string similar to The collection item type {0} has already been registered as a single-valued service. Register the collection before adding instances to it..
Looks up a localized string similar to The {0} service is exposed multiple times by the same component..
Looks up a localized string similar to A component named '{0}' has already been registered. Component names must be unique within a container..
Looks up a localized string similar to The provided registration does not support the required service..
Looks up a localized string similar to Service types cannot be null..
A component activator that returns an already-created instance.
The activator only works once. Subsequent calls to ActivateInstance()
will result in a failure (this is to comply with the requirements
of the interface.)
Create a new InstanceComponentActivator that will
return from ActivateInstance().
The instance provided by this activator.
Create a component instance, using container
to resolve the instance's dependencies.
The context to use
for dependency resolution.
Unused.
A component instance. Note that while the
returned value need not be created on-the-spot, it must
not be returned more than once by consecutive calls. (Throw
an exception if this is attempted. IActivationScope should
manage singleton semantics.)
Returns a that represents the current .
A that represents the current .
A 'new context' is a scope that is self-contained
and that can dispose the components it contains before the parent
container is disposed. If the activator is stateless it should return
true, otherwise false.
true if this instance can support a new context; 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 Provided Instance.
Looks up a localized string similar to The component instance '{0}' does not support the service '{1}'..
Looks up a localized string similar to A component registered as an instance can only support a single-instance lifecycle model, e.g. singleton..
Selects the constructor with the most parameters.
Returns the most suitable constructor from those provided.
Required. Must contain at least one item.
The most suitable constructor.
A component activator that creates a new instance of a
type using reflection to select and invoke a constructor
based on the available service registrations.
Initializes a new instance of the class.
Type of the component.
Initializes a new instance of the class.
Type of the component.
The additional constructor parameters.
Initializes a new instance of the class.
Type of the component.
The additional constructor parameters.
The explicit property setters.
Initializes a new instance of the class.
Type of the component.
The additional constructor parameters.
The explicit property setters.
The constructor selector.
Create a component instance, using container
to resolve the instance's dependencies.
The context to use
for dependency resolution.
Parameters that can be used in the resolution process.
A component instance. Note that while the
returned value need not be created on-the-spot, it must
not be returned more than once by consecutive calls. (Throw
an exception if this is attempted. IActivationScope should
manage singleton semantics.)
Returns a that represents the current .
A that represents the current .
A 'new context' is a scope that is self-contained
and that can dispose the components it contains before the parent
container is disposed. If the activator is stateless it should return
true, otherwise false.
true if this instance can support a new context; otherwise, false.
The type that will be used to reflectively instantiate the component instances.
The actual implementation type may be substituted with a dynamically-generated subclass.
Note that functionality that relies on this feature will obviously not be available to provided instances or
to delegate-created instances; interface-based AOP is recommended in these situations.
Gets or sets the constructor invoker.
The constructor invoker.
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 component '{0}' does not support the service '{1}'..
Looks up a localized string similar to Reflective.
Looks up a localized string similar to parameter '{0}' of type '{1}' is not resolvable.
Looks up a localized string similar to The component '{0}' has no public constructors..
Looks up a localized string similar to The component '{0}' has no resolvable constructors. Unsuitable constructors included:{1}.
Looks up a localized string similar to Parameter names cannot be null or empty (component '{0}')..
Looks up a localized string similar to The parameter '{0}' has been specified multiple times for component '{1}'..
Looks up a localized string similar to Property names cannot be null or empty (component '{0}')..
Looks up a localized string similar to No property named '{0}' exists on component '{1}'..
Looks up a localized string similar to The property '{0}' has been specified multiple times for component '{1}'..
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.
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.
A service was requested that cannot be provided
by the container.
Initializes a new instance of the class.
Initializes a new instance of the class.
The service.
Initializes a new instance of the class.
The service.
The inner exception.
Initializes a new instance of the class.
The that holds the serialized object data about the exception being thrown.
The that contains contextual information about the source or destination.
The parameter is null.
The class name is null or is zero (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 The requested service '{0}' has not been registered..
Restricts the component to providing a single instance in the root context only.
Try to create a scope container for a new context.
The duplicate.
True if the semantics of the scope model allow for new contexts.
Returns a that represents the current .
A that represents the current .
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 context activation scope can only contain one instance, and the current instance has already been set..
Looks up a localized string similar to Container.
Looks up a localized string similar to The contextual instance has not been created. Check for this condition with InstanceAvailable before calling GetInstance()..
Chooses a constructor based on an exact signature.
Initializes a new instance of the class.
The constructor signature.
Returns the most suitable constructor from those provided.
Required. Must contain at least one item.
The most suitable 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 The required constructor is unavailable..
Looks up a localized string similar to A constructor type signature cannot contain 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 No context was found with tag '{0}', or the component is registered with singleton scope..
Looks up a localized string similar to {0}, Tag = {1}.
Registered in the container to support tagged extensions. Stores the
tag for a single container, and allows traversal of the context tree.
The tag for the current context. Can only be accessed when HasTag is true.
Gets a value indicating whether this instance has a tag.
true if this instance has a tag; 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 context does not have a tag value applied..
A TaggedRegistration decorates an IComponentRegistration to implement the Autofac tagging feature.
Create a new TaggedRegistration.
The tag corresponding to the context in which this
component may be resolved.
The decorated registration.
Must return a valid instance, or throw
an exception on failure.
The context that is to be used
to resolve the instance's dependencies.
Parameters that can be used in the resolution process.
The disposer.
if set to true a new instance was created.
A newly-resolved instance.
Create a duplicate of this instance if it is semantically valid to
copy it to a new context.
The duplicate.
True if the duplicate was created.
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 instance.
Disposes the innner registration.
Returns a that represents the current .
A that represents the current .
Gets the tag applied to the registration.
The tag.
Describes the component registration and the
services it provides.
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.
Tags are implemented as decorators over other kinds of component registrations. The inner
registration is the decorated instance.
A parameter that can supply values to sites that exactly
match a specified type.
Create a typed parameter for the specified type.
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 sites are matched.
Identifies a service according to a type to which it can be assigned.
Initializes a new instance of the class.
Type of the service.
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 or sets the type of the service.
The type of the service.
Gets a human-readable description of the service.
The description.
Some handy type conversion routines.
Does its best to convert whatever the value is into the destination
type. Null in yields null out for value types and the default(T)
for value types (this may change.)
The value.
Type of the destination.
An object of the destination type.
A handy unique service identifier type - all instances will be regarded as unequal.
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.