Table of Contents

Interface IContainerRegistration

Namespace
Unity
Assembly
Unity.Abstractions.dll

Information about the types registered in a container.

Types registered with container are stored in registry and exposed to outside world through Registrations enumeration. Each record is represented by an instance of this interface.

public interface IContainerRegistration
Extension Methods

Properties

LifetimeManager

The lifetime manager for this registration.

LifetimeManager LifetimeManager { get; }

Property Value

LifetimeManager

Instance of lifetime manager associated with the registration

Remarks

Each Unity registration is assigned a lifetime manager that controls how the container creates, manages, and disposes of created objects. Even if manager is not assigned explicitly, Unity will pick default type and add it to the registration.

See Also

MappedToType

The type that this registration is mapped to.

Type MappedToType { get; }

Property Value

Type

The type of object created when registered type is requested

Remarks

Type MappedToType informs container how to build the requested instance. Based on how it was registered, the Type could be built from this registration or redirected to mapped registration to satisfy the request.

Name

Name the registered type. Null for default registration.

string Name { get; }

Property Value

string

Name of the registration

Remarks

Each registration is uniquely identified by RegisteredType and Name. Registering the same Type with different names will create distinct registrations for each RegisteredType and Name combinations. Registration with no Name (name == null) is called default registration. The container uses these as implicit defaults when required.

RegisteredType

Type of the registration.

Type RegisteredType { get; }

Property Value

Type

The type registered with the container

Remarks

This Type is what container stores in its internal registry. When resolving, it will look for this Type to satisfy dependencies.