Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

UnityContainerExtensions.BuildUp<T> Method (IUnityContainer, T, ResolverOverride[])

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)

public static T BuildUp<T>(
	this IUnityContainer container,
	T existing,
	params ResolverOverride[] resolverOverrides
)

Parameters

container
Type: Microsoft.Practices.Unity.IUnityContainer
Container to resolve through.
existing
Type: T
Instance to build up.
resolverOverrides
Type: Microsoft.Practices.Unity.ResolverOverride []
Any overrides for the buildup.

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).

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.

Show:
© 2015 Microsoft