title: Resolve dependency with autofac based on constructor parameter attribute
body: <p>I'm using Autofac. I want to inject a different implementation of a dependency based on an attribute I apply to the constructor parameter. For example:</p>
  
  <pre><code>class CustomerRepository
  {
      public CustomerRepository([CustomerDB] IObjectContainer db) { ... }
  }
  
  class FooRepository
  {
      public FooRepository([FooDB] IObjectContainer db) { ... }
  }
  
  builder.Register(c =&gt; /* return different instance based on attribute on the parameter */)
         .As&lt;IObjectContainer&gt;();
  </code></pre>
  
  <p>The attributes will be providing data, such as a connection string, which I can use to instance the correct object.</p>
  
  <p>How can I do this?</p>