title: Registering implementations of base class with Autofac to pass in via IEnumerable
body: <p>I have a base class, and a series of other classes inheriting from this:<br>
  <em>(Please excuse the over-used animal analogy)</em></p>
  
  <blockquote>
    <p>public abstract class Animal { }</p>
    
    <p>public class Dog : Animal { }</p>
    
    <p>public class Cat : Animal { }</p>
  </blockquote>
  
  <p>I then have a class that has a dependancy on an <code>IEnumerable&lt;Animal&gt;</code></p>
  
  <pre><code>public class AnimalFeeder
  {
      private readonly IEnumerable&lt;Animal&gt; _animals;
  
      public AnimalFeeder(IEnumerable&lt;Animal&gt; animals )
      {
          _animals = animals;
      }
  }
  </code></pre>
  
  <p>If I manually do something like this:</p>
  
  <pre><code>var animals =
      typeof(Animal).Assembly.GetTypes()
          .Where(x =&gt; x.IsSubclassOf(typeof(Animal)))
          .ToList();
  </code></pre>
  
  <p>Then I can see that this returns <code>Dog</code> and <code>Cat</code></p>
  
  <p>However, when I try to wire up my Autofac like this:</p>
  
  <pre><code>builder.RegisterAssemblyTypes(typeof(Animal).Assembly)
      .Where(t =&gt; t.IsSubclassOf(typeof(Animal)));
  
  builder.RegisterType&lt;AnimalFeeder&gt;();
  </code></pre>
  
  <p>When <code>AnimalFeeder</code> is instantiated, there are no <code>Animal</code> passed in to the constructor.</p>
  
  <p>Have I missed something?</p>