title: DryIoc RegisterMany implementations of interface
body: <p>Looking at the <a href="https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/RegisterResolve.md#registermany" rel="nofollow noreferrer">wiki</a> for DryIoc, it seems the examples show the reverse of what I need, and I was wondering if the reverse is possible?</p>
  <p>Wiki <em>(partial example)</em></p>
  <pre><code>public interface X {}
  public interface Y {}
  
  public class A : X, Y {}
  public class B : X, IDisposable {}
  
  
  // Registers X, Y and A itself with A implementation 
  container.RegisterMany&lt;A&gt;();
  
  ...
  </code></pre>
  <p>I would like to do the following</p>
  <pre><code>container.RegisterMany&lt;X&gt;();
  
  // This would return one implementation each of A and B
  container.ResolveMany&lt;X&gt;();
  </code></pre>
  <p>However that gives this error: <code>&quot;Registering abstract implementation type X when it is should be concrete. Also there is not FactoryMethod to use instead.&quot;</code></p>
  <p>Is this possible out of the box or do I need to implement it myself by getting all implementations of an interface from an assembly and loop over it and register it accordingly?</p>
  <p><strong>UPDATE</strong></p>
  <p>I see that this example was maybe a little to simple for my case, but for the example above, the code @dadhi provided works great.</p>
  <p>Here is a bit more &quot;complex&quot; case</p>
  <pre><code>namespace Assembly.A
  {
      interface IImporter { }
  
      abstract class ImporterBase : IImporter { }
  }
  
  namespace Assembly.B
  {
      interface IStuffImporter : IImporter { }
      interface IOtherImporter : IImporter { }
  
      class StuffImporter : ImporterBase, IStuffImporter { }
      class OtherImporter : ImporterBase, IOtherImporter { }
  }
  
  namespace Assembly.C
  {
      class Program
      {
          void Main()
          {
              var container = new Container();
  
              container.RegisterMany( new[] { typeof(StuffImporter).Assembly }, type =&gt; type.IsAssignableTo(typeof(IImporter)) &amp;&amp; type.IsClass &amp;&amp; !type.IsAbstract);
              //I would like DryIoc to do the following behind the scenes
              //container.Register&lt;IStuffImporter, StuffImporter&gt;();
              //container.Register&lt;IOtherImporter, OtherImporter&gt;();
  
              var importers = container.ResolveMany&lt;IImporter&gt;();
  
              importers.Should().HaveCount(2);
              importers.First().Should().BeOfType&lt;StuffImporter&gt;().And.BeAssignableTo&lt;IStuffImporter&gt;();
              importers.Last().Should().BeOfType&lt;OtherImporter&gt;().And.BeAssignableTo&lt;IOtherImporter&gt;();
          }
      }
  }
  </code></pre>
  <p><strong>Would something like this be doable out of the box? Or do I need to make my own extension methods etc?</strong> It wouldn't be that much of a trouble really, and I would probably be done with it in a short time, however I would like to know for future references and to learn the DryIoc container. Thnxs in advance. :)</p>