I'm trying to create controller instance manually, but it has some dependencies by unity and now I'm just resolving all of them automatically and pass them to controller constructor
var c = new MyController(container.Resolve<IInterface1>(),
container.Resolve<IInterface2>())
Is it possible to create controller instance through Unity to get all dependencies automatically resolved?
You can use
InjectionConstructor
to archive that. For example:Then combine this approach with ControllerFactory.