title: How to inject dependency name as a constructor parameter
body: <p>Using Autofac, I can register a class to resolve against an interface using property injection, using the following code:</p>
  
  <pre><code>builder.RegisterType&lt;Log4NetAdapter&gt;()
         .As&lt;ILogger&gt;()
         .PropertiesAutowired()
         .InstancePerDependency();
  </code></pre>
  
  <p>However, my <code>Log4NetAdapter</code> class has a constructor parameter that requires the name of the calling class. This way, I can log events based upon the name of the calling class.</p>
  
  <pre><code>public class Log4NetAdapter : ILogger
  {
      private readonly ILog _logger;
  
      public Log4NetAdapter(string logName)
      {
          _logger = LogManager.GetLogger(logName);
      }
  
      ...
  }
  </code></pre>
  
  <p>How can I inject the name (i.e. <code>typeof(dependency).Name</code>) of the dependency into the property-injected class' constructor given that each dependency will have its own <code>Log4NetAdapter</code> instance?</p>