UnityContainerBase.BuildUp<T> Method (T)

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.

Run an existing object through the container and perform injection on it.

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

Syntax

'Declaration
Public Function BuildUp(Of T) ( _
    existing As T _
) As T
public T BuildUp<T>(
    T existing
)
public:
generic<typename T>
virtual T BuildUp(
    T existing
) sealed
JScript does not support generic types or methods.

Parameters

  • existing
    Type: T
    Instance to build up.

Type Parameters

  • T
    Type of object to perform injection on.

Return Value

The resulting object. By default, this will be existing, but container extensions may add things like automatic proxy creation which would cause this to return a different object (but still type compatible with T).

Remarks

This method is useful when you don't control the construction of an instance (ASP.NET pages or objects created via XAML, for instance) but you still want properties and other injection performed.

This overload uses the default registrations.

See Also

UnityContainerBase Class

BuildUp Overload

Microsoft.Practices.Unity Namespace