The right way to do property dependency injection using Unity
问题 I have a class that needs a dependency injecting. As the class is already an implementation of another abstraction, and its 'sibling' implementations may not share the same dependencies, I am attempting to use property injection and not constructor injection. (All these classes/interface names are just for illustrative purposes) My IProvider abstraction: public interface IProvider { void ProviderMethod(); } My IProvider implementation (with the IData dependency I want to inject) : public