title: Unity IoC resolve and inject a collection of classes implementing a common interface
body: <p>I have few classes implementing the same interface, registered under different names. I want to inject them as a collection into a constructor, which unity doesn't understand.</p>
  
  <pre><code>interface IA{}
  interface IB { IEnumerable&lt;IA&gt; As { get; set; } }
  class A1 : IA{}
  class A2 : IA {}
  
  class B : IB
  {
      public IEnumerable&lt;IA&gt; As { get; set; }
      public B(IEnumerable&lt;IA&gt; ass)
      {
          As = ass;
      }
  
      public B(IA a)
      {
          var b = 1;
      }
  }
  </code></pre>
  
  <p>Now I want inject them</p>
  
  <pre><code>[TestMethod]
  public void ResolveMultiple()
  {
      var container = new UnityContainer();
      container.RegisterType&lt;IA, A1&gt;("A1");
      container.RegisterType&lt;IA, A2&gt;("A2");
      container.RegisterType&lt;IB, B&gt;();
  
      var b = container.Resolve&lt;IB&gt;();
      Assert.IsNotNull(b);
      Assert.IsNotNull(b.As);
      var manyAss = container.ResolveAll&lt;IA&gt;();
  }
  </code></pre>
  
  <p>The last line works, so I got collection of two classes (A1, A1) , but B class is not created.</p>
  
  <p>Is there any extra configuration needed?</p>