title: Castle Windsor: Using convention registration along with specific implementations
body: <p>Assume we have IFoo implemented by Foo and IBar implemented by FirstBar and SecondBar.</p>
  
  <p>Using this convention registration:</p>
  
  <pre><code>container.Register(
      AllTypes.FromThisAssembly().Pick()
          .WithService.DefaultInterface())
  </code></pre>
  
  <p>We'll have three entries in the container:</p>
  
  <pre><code>IFoo = Foo
  IBar = FirstBar
  IBar = SecondBar
  </code></pre>
  
  <p>Now, how can we tweak this registration to be able to tell the container that for IBar we want SecondBar registered only? Sort of:</p>
  
  <pre><code>container.Register(
      AllTypes.FromThisAssembly().Pick()
          .WithService.DefaultInterface()
          .For&lt;IBar&gt;().Select&lt;SecondBar&gt;())
  </code></pre>
  
  <p>Use case: we have lots of services in our app all registered by conventions. However, some of the service interfaces have two or more implementations (e.g. real implementation, fake implementation and test implementation). Convention registration will register them all under the same interface and while resolving the interface we'll get the first implementation (in nondeterministic order). We want to be able to select one specific implementation for those services while registering. How can we do that?</p>