I'm trying to instantiate a new class using the type passed in and then use the Unity Container to build up the object to inject its dependencies.
The Unity Container does not have any extensions/strategies. I'm just using an unaltered unity container. It's properly loading the configuration and used in other places in the code to resolve dependencies on items.
I've got the following code:
// Create a new instance of the summary.
var newSummary = Activator.CreateInstance(message.SummaryType) as ISummary;
this.UnityContainer.BuildUp(newSummary.GetType(), newSummary);
// Code goes on to use the variable as an ISummary...
The [Dependency] properties (which are public and standard get; set;) of the class are not being injected. They are all still null after the BuildUp method is called. Is there something obvious that I'm doing wrong?
Thanks in advance.