title: How to conditionally bind a instance depending on the injected type using unity?
body: <p>I'm used to Ninject, and for a specific project I'm asked to learn Unity.</p>
  
  <p>There is one thing i can't find information on how to do.</p>
  
  <p>In Ninject I can state:</p>
  
  <pre><code>Bind&lt;IWarrior&gt;().To&lt;Samurai&gt;().Named("Samurai");
  Bind&lt;IWarrior&gt;().To&lt;Ninja&gt;().Named("Ninja");
  Bind&lt;IWeapon&gt;().To&lt;Katana&gt;().WhenInjectedInto(typeof(Samurai));
  Bind&lt;IWeapon&gt;().To&lt;Shuriken&gt;().WhenInjectedInto(typeof(Ninja));
  </code></pre>
  
  <p>And then when one asks for the warrior named samurai, the samurai comes with kanana and the ninja comes with shurikens. As it should.</p>
  
  <p>I don't want to reference the container in the warriors to get the appropriate weapon, and don't want to contaminate the model with attributes (is in another assembly that doesn't have reference to ninject or unity)</p>
  
  <p>PD: I'm looking for a code way, not via xml config.</p>