title: Register all class that implements IValidator<SomethingValidatable> with Unity
body: <p>Suppose I defined some validation logic like this:</p>
  
  <pre><code>public class Rule1 : IValidator&lt;SomethingValidatable&gt;
  {
      public IList&lt;Error&gt; Validate(SomethingValidatable item) 
      {
           // apply validation logic to item
      }
  }
  </code></pre>
  
  <p>Somewhere in code I bind <code>IValidator&lt;SomethingValidatable&gt;</code> to one or more concrete <code>Rule</code>:</p>
  
  <pre><code>protected override void ConfigureContainer(IUnityContainer container)
  {
      container
          .RegisterType&lt;IValidator&lt;SomethingValidatable&gt;, Rule1&gt;("a")
          .RegisterType&lt;IValidator&lt;SomethingValidatable&gt;, Rule2&gt;("b");
  }
  </code></pre>
  
  <p>and where I need this validation occurs I have somethin like:</p>
  
  <pre><code>public class HereIValidateClass 
  {
      private readonly IValidator&lt;SomethingValidatable&gt;[] validators;
  
      public HereIValidateClass(IValidator&lt;SomethingValidatable&gt;[] validators)
      {
          this.validators = validators;
      }
  
      public IList&lt;Error&gt; DoSomething() 
      {
          foreach (var validator in validators)
          {
              var errors = validator.Validate(something);
              // append to IList&lt;Error&gt;
          }
  
          return errors;
      }
  }
  </code></pre>
  
  <p>This do the job. But I would avoid to register explicitely one by one each rules. I really like to say: <em>Dear Unity, register each class in a given namespace that implements <code>IValidator&lt;SomethingValidatable&gt;</code></em>. </p>