AutoFac creation type regardless of availability

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.

+3
source share
2 answers

Autofac cannot resolve a type that has not been registered, even if that type is concrete with one constructor open.

, Autofac Mvc3Ingegration , RegisterControllers . :

builder.RegisterControllers(typeof(MvcApplication).Assembly);
+6

Autofac , Unity:

builder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource());

.

, , . Autofac MVC. , MVC3 - . .

factory, , " -":)

+9