IUnityContainer.RegisterType Method (Type, Type, String, LifetimeManager, array<InjectionMember[])

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Unity Application Block information can be found at the Unity Application Block site.

Register a type mapping with the container, where the created instances will use the given LifetimeManager.

Namespace: Microsoft.Practices.Unity
Assembly: Microsoft.Practices.Unity (in Microsoft.Practices.Unity.dll)

Syntax

'Declaration
Function RegisterType ( _
    from As Type, _
    to As Type, _
    name As String, _
    lifetimeManager As LifetimeManager, _
    ParamArray injectionMembers As InjectionMember() _
) As IUnityContainer
IUnityContainer RegisterType(
    Type from,
    Type to,
    string name,
    LifetimeManager lifetimeManager,
    params InjectionMember[] injectionMembers
)
IUnityContainer^ RegisterType(
    Type^ from, 
    Type^ to, 
    String^ name, 
    LifetimeManager^ lifetimeManager, 
    ... array<InjectionMember^>^ injectionMembers
)
function RegisterType(
    from : Type, 
    to : Type, 
    name : String, 
    lifetimeManager : LifetimeManager, 
    ... injectionMembers : InjectionMember[]
) : IUnityContainer

Parameters

  • name
    Type: System.String
    Name to use for registration, null if a default registration.

Return Value

The UnityContainer object that this method was called on (this in C#, Me in Visual Basic).

See Also

IUnityContainer Interface

RegisterType Overload

Microsoft.Practices.Unity Namespace