I am trying to use Autofac and Autofac.Integrations.Web to register ASP.NET MVC controllers. I am currently using assembly scanning to find the controllers but one of them needs a special parameter that I would prefer to pass in instead. Found below are the registrations I have tried.
var builder = new ContainerBuilder();
builder.RegisterControllers(Assembly.GetExecutingAssembly());
// so far I have tried
builder.Register<SpecialController>(c =>
new SpecialController(wierdParam, c.Resolve<IDependency>())
).Named<SpecialController>("controller.special")
.As<SpecialController>().As<IController>();
/* And this
builder.Register<SpecialController>(c =>
new SpecialController(url, c.Resolve<IDependency>())
);
*/
/* plus this
builder.Register<SpecialController>(c =>
new SpecialController(url, c.Resolve<IDependency>())
).Named<SpecialController>("controller.special");
*/
Thank you for your help.