How to configure Unity so that any class derived from some base class would go through injection pipeline defined for base class.
public abstract class Base
{
public IDependency Dependency {get;set;}
};
public class Derived1: Base
{
};
public class Derived2: Base
{
};
container.RegisterType<Base>(new InjectionProperty("Dependency", new ResolvedParameter<IDependency>()));
var d1 = container.Resolve<Derived1>();
Thus, I need to register base class with Unity while resolve derived classes so that all injections specified for base class would be applied to derived classes.
Decorating base class property with DependencyAttribute
is not allowed due to my project restrictions.