title: Ninject bind all classes implementing the same interface
body: <p>I have an interface class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public interface IStartUpTask
  {
      bool IsEnabled { get; }
      void Configure();
  }
  </code></pre>
  
  <p>I have multimple classes implementing the same interface</p>
  
  <p>One of the classes looks like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Log4NetStartUpTask : IStartUpTask
  {
      public bool IsEnabled { get { return true; } }
  
      public void Configure()
      {
          string log4netConfigFilePath = ConfigurationManager.AppSettings["log4netConfigFilePath"];
          if (log4netConfigFilePath == null)
              throw new Exception("log4netConfigFilePath configuration is missing");
  
          if (File.Exists(log4netConfigFilePath) == false)
              throw new Exception("Log4Net configuration file was not found");
  
          log4net.Config.XmlConfigurator.Configure(
              new System.IO.FileInfo(log4netConfigFilePath));
      }
  }
  </code></pre>
  
  <p>How can i tell Ninject that i want all the classes implementing the <code>IStartUpTask</code> to bind to themself automatically?</p>
  
  <p>I found an example using StructureMap which does this, but i don't know how to do it in Ninject.</p>
  
  <pre class="lang-cs prettyprint-override"><code>Scan(x =&gt; {
      x.AssemblyContainingType&lt;IStartUpTask&gt;();
      x.AddAllTypesOf&lt;IStartUpTask&gt;();
      x.WithDefaultConventions();
  });
  </code></pre>