UnityContainer.BuildUp Method
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 ( _
t As Type, _
existing As Object, _
name As String, _
ParamArray resolverOverrides As ResolverOverride() _
) As Object
public Object BuildUp(
Type t,
Object existing,
string name,
params ResolverOverride[] resolverOverrides
)
public:
virtual Object^ BuildUp(
Type^ t,
Object^ existing,
String^ name,
... array<ResolverOverride^>^ resolverOverrides
) sealed
public final function BuildUp(
t : Type,
existing : Object,
name : String,
... resolverOverrides : ResolverOverride[]
) : Object
Parameters
- t
Type: System.Type
Type of object to perform injection on.
- existing
Type: System.Object
Instance to build up.
- name
Type: System.String
name to use when looking up the typemappings and other configurations.
- resolverOverrides
Type: array<Microsoft.Practices.Unity.ResolverOverride[]
Any overrides for the buildup.
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).
Implements
IUnityContainer.BuildUp(Type, Object, String, array<ResolverOverride[])
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.