I have this interface that is used by several specific types such as EmailFormatter , TextMessageFormatter , etc.
public interface IFormatter<T> { T Format(CompletedItem completedItem); }
The problem I am facing is that with my EmailNotificationService I want to insert an EmailFormatter . The constructor signatures for this service are public EmailNotificationService(IFormatter<string> emailFormatter) .
I'm sure I saw this before, but how do I register this with Windsor so that it EmailFormatter if the name of the parameter is the EmailFormatter constructor?
Here is my Windsor registration code.
container.Register(Component.For<IFormatter<string>>().ImplementedBy<EmailFormatter>());
source share