I’m wondering what the differences are between the ‘AddProperty’ method of the ComponentModel and the ‘CustomDependencies’ dictionary. I’m trying to set the dependency for a property on an component after it has already been registered in the container.
First I retrieve the component from the kernel
var registration = container.Kernel.GetAssignableHandlers(component).Select(x => x.ComponentModel).SingleOrDefault();
Then I’m looking to set a property dependency on that component. It seems to work when using the CustomDependencies dictionary, but I’m just wondering what the differences are.
AddPropertyas the name implies declares dependency on a property existing on the implementation type.CustomDependenciesis a generic way of associating any sort of dependency values with the component. Those can be used for anything.and if you want to add dependencies to a component do it in a
IContributeComponentModelConstruction(yeah, that’s a mouthful)