title: Factory with Autofac dependencies
body: <p>I want to write a factory for creating various types of "xxNotification" classes. My concrete "xxNotification" has dependencies registered with AutoFac. I would like to get/resolve instance of "xxNotification" using Autofac. How to do that?</p>
  
  <pre><code>public interface INotification
  {
      void Notify(string Action, int OrderID);
  }
  
  public class MagentoOrderStateNotification : INotification
  {
      private readonly GenericRepository&lt;Order&gt; _orderRepository;
      private readonly OMRestIntegrationService _oMRestIntegrationService;
  
      public MagentoOrderStateNotification(GenericRepository&lt;Order&gt; orderRepository, OMRestIntegrationService oMRestIntegrationService)
      {
          _orderRepository = orderRepository;
          _oMRestIntegrationService = oMRestIntegrationService;
      }
  
      public void Notify(string Action, int OrderID)
      {
          //implementation...
      }
  }
  
  public class NotificationFactory
  {
      public INotification GetNotification(string NotificationName)
      {
          switch (NotificationName)
          {
              case "MagentoOrderStateNotification":
                  //resolve instance of MagentoOrderStateNotification
          }
      }
  }
  </code></pre>