title: Autofac Dependency Injection on Action Method Parameters ( ASP MVC3 )
body: <p>I have the following setup</p>
  
  <pre><code>public interface IObject 
  { 
      string Name { get; set;}
  }
  
  public class ConcreteObject : IObject 
  {
      public string Name { get; set; }
  }
  public ActionResult Index(IObject myObject)
  {        
      return View();
  }
  </code></pre>
  
  <p>I have a concrete class which implements IObject, and I am using dependency injection to bind this concrete class to the interface.</p>
  
  <p>Using Autofac, I have the following setup also</p>
  
  <pre><code>var builder = new ContainerBuilder();
  builder.RegisterModule(new AutofacWebTypesModule());
  builder.RegisterSource(new ViewRegistrationSource());
  builder.RegisterFilterProvider();
  builder.RegisterControllers(Assembly.GetExecutingAssembly()).InjectActionInvoker().PropertiesAutowired();
  builder.RegisterModelBinders(Assembly.GetExecutingAssembly());
  builder.RegisterModelBinderProvider();
  builder.RegisterType&lt;ExtensibleActionInvoker&gt;().As&lt;IActionInvoker&gt;().WithParameter("injectActionMethodParameters", true);
  builder.RegisterType&lt;ConcreteObject&gt;().As&lt;IObject&gt;().InstancePerHttpRequest();            
  var container = builder.Build();
  DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
  </code></pre>
  
  <p>When I run this, I get an instance of the concrete class, but any paramaters that would usually be bound from the querystring are now null. ie: Home/Index?Name=test would bind an instance, but not bind the parameter Name. Is there a way to ensure that modelbinding still happens after DI?</p>