Wonder if someone could give a hint how to support at a contuctor the injection of a NameValueCollection using configuration file where I have several value pairs to be set into the contructor. someting like this.
So i can have code to resolve the IType like this:
var myType = container.Resolve<IType>();
I will appreciate any feedback.
Thanks in advance.
If you can cram the contents of your NameValueCollection into a string, then you can use a custom type converter to build it for you. Otherwise, you'll need a custom configuration element. This is supported but not documented, unfortunately. You'd need
to subclass Microsoft.Practices.Unity.Configuration.InjectionParameterValueElement. Then provide an elementType="" attribute in the XML config to tell the config system what your element type is. Unfortunately you can't use an alias for the element
Hope this is enough to point you in the right direction,