I'm trying to register decorator base on IInterface
, I have several classes implementing the same interface.
public class Instance_A : IInterface
{}
public class Instance_B : IInterface
{}
without decorator the registration looks like :
AllTypes.FromAssemblyContaining<IInterface>().BasedOn<IInterface>()
.Configure(c => c.LifeStyle.Transient.Named(c.Implementation.Name))
I have added decorator:
public class InstanceDecorator : IInterface
{
public InstanceDecorator (IInterface instance)
{
Instance= instance;
}
}
How can i register the decorator, and get its implementation when i'm trying to resolve one of the implemented classes ?