I use constructor injection in my solution, but this one class has a property that I do not want to pass in the constructor, where I have invariant dependencies.
Say I have an ILogger, and I have a FileName property that I want to set, but at the same time it sets the dependencies in the contructor. How can I switch to type registration and at the same time pass the defaunt connection string.
I hope there is an easy way to do this - preferably without decorating the property with an attribute, but if setting up is easier with an attribute, I think it's cool :)
So the question is, how do I paste the value of a property onto an object that also uses constructor injection - with Unity.
UPDATE: I mentioned this in the title, but I forgot to work in the text - I want to install these dependencies manually (in the code), and not in the configuration file.
source
share