I want to use AutoFac to insert links into the constructor of an object. However, the actual object itself is not registered. I do this for an ASP.NET MVC factory controller, where the controller will not be registered, but there will be constructor parameters. I managed to do this in unity, but I have problems with AutoFac.
Is it possible?
Thank.
Autofac cannot resolve a type that has not been registered, even if that type is concrete with one constructor open.
, Autofac Mvc3Ingegration , RegisterControllers . :
RegisterControllers
builder.RegisterControllers(typeof(MvcApplication).Assembly);
Autofac , Unity:
builder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource());
.
, , . Autofac MVC. , MVC3 - . .
factory, , " -":)