Wednesday, May 22, 2013

Wednesday Quickie: Using BuildUp with Unity

Here's a quick reminder...

When using Unity and its BuildUp() method to fulfil property-injection dependencies, the syntax

container.BuildUp(myObject)

will not in itself work - even though it compiles just fine! Instead, use

container.BuildUp(myObject.GetType(), myObject)

and the property-injection dependencies will be fulfilled.

No comments: