Show / Hide Table of Contents

Interface IContainerRegistration

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.

Namespace: Unity
Assembly: Unity.Abstractions.dll
Syntax
public interface IContainerRegistration

Properties

| Improve this Doc View Source

LifetimeManager

The lifetime manager for this registration.

Declaration
LifetimeManager LifetimeManager { get; }
Property Value
Type Description
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
Unity.Lifetime
| Improve this Doc View Source

MappedToType

The type that this registration is mapped to.

Declaration
Type MappedToType { get; }
Property Value
Type Description
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.

| Improve this Doc View Source

Name

Name the registered type. Null for default registration.

Declaration
string Name { get; }
Property Value
Type Description
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.

| Improve this Doc View Source

RegisteredType

Type of the registration.

Declaration
Type RegisteredType { get; }
Property Value
Type Description
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.

Extension Methods

InjectionMatching.Matches(Object, Type)
InjectionMatching.MatchesObject(Object, Type)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2020 .NET Foundation and Contributors. All Rights Reserved