title: How to inject proper dependency based on constructor parameter name
body: <p>I have this interface that is being used by a handful of concrete types, such as <code>EmailFormatter</code>, <code>TextMessageFormatter</code> etc.</p>
  
  <pre><code>public interface IFormatter&lt;T&gt;
  {
      T Format(CompletedItem completedItem);
  }
  </code></pre>
  
  <p>The issue I'm having is that with my <code>EmailNotificationService</code> is that I want to inject <code>EmailFormatter</code>. The constructor signature for this service is <code>public EmailNotificationService(IFormatter&lt;string&gt; emailFormatter)</code>.</p>
  
  <p>I'm pretty sure I've seen this done before but how do I register this with Windsor so that it injects <code>EmailFormatter</code> if the constructor parameter name is <code>emailFormatter</code>?</p>
  
  <p>Here is my Windsor registration code.</p>
  
  <pre><code>container.Register(Component.For&lt;IFormatter&lt;string&gt;&gt;().ImplementedBy&lt;EmailFormatter&gt;());
  </code></pre>