title: factory pattern in autofac
body: <p>I want to implement factory pattern in Autofac. This is how it was done in Ninject:</p>
  
  <pre><code>Bind&lt;ICarFilter&gt;().To&lt;CarFilter &gt;();
  Bind&lt;IBikeFilter&gt;().To&lt;BikeFilter&gt;();
  Bind&lt;IFilterFacade&gt;().ToFactory().InSingletonScope();
  </code></pre>
  
  <p>This is a definitnion of IFilterFacade</p>
  
  <pre><code>public interface IFilterFacade
      {    
          ICarFilter CreateCarFilter();
  
          IBikeFIlter CreateBikeFilter();         
      }
  </code></pre>
  
  <p>If I want an instance of CarFilter type, all I need to do is the following:</p>
  
  <pre><code>public class HomeController(IFilterFacade filterFacade)
  {
      FilterFacade = filterFacade;
  }
  
  public IFilterFacade FilterFacade { get;set; }
  
  public ActionResult Index()
  {
    var bikeFilter = FilterFacade.CreateBikeFilter();
  }
  </code></pre>
  
  <p>Any example how to do that in AutoFac. I checked AutoFac documentation, but was not able to find the answer or example. </p>