title: AutoFac not resolving WebAPI
body: <p>My AutoFac implementation doesn't appear to be injecting any concrete instances of my interfaces into my API controllers.</p>
  
  <p>Inspecting the Container object it does have a awareness of the UserRepo - it just does nothing with it.</p>
  
  <p>Using latest version of AutoFac (Nuget) and AutoFac/WebAPI and Autofc/MVC5.</p>
  
  <pre><code> public class ContainerConfig
      {
          public static void RegisterContainer()
          {
              var builder = new ContainerBuilder();
  
              builder.RegisterApiControllers();
  
              //var asm = typeof(IUserRepository).Assembly;
              builder.RegisterAssemblyTypes(typeof(UserRepository).Assembly)
                  .Where(x =&gt; x.Name.EndsWith("Repository")).AsImplementedInterfaces();
  
              var container = builder.Build();
              GlobalConfiguration.Configuration.DependencyResolver= new AutofacWebApiDependencyResolver(container);
              DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
          }
      }
  </code></pre>
  
  <hr>
  
  <pre><code>public class UsersController : ApiController
  {
      IUserRepository _db;
  
      public UsersController(IUserRepository db)
      {
          _db = db;
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class WebApiApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
          GlobalConfiguration.Configure(WebApiConfig.Register);
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes);
          Database.SetInitializer&lt;FindABriefContext&gt;(new DbInit());
          ContainerConfig.RegisterContainer();
      }
  }
  </code></pre>
  
  <hr>
  
  <p>public class UserRepository : IUserRepository
      {
          DbContext db = null;</p>
  
  <pre><code>    public UserRepository(DbContext context)
      {
          db = context;
      }
  }
  </code></pre>