public object GetInstance(Type controllerType, out IDisposable lifetimeScope) { var scope = _container.BeginLifetimeScope(); object instance; var ex = scope.TryResolve(controllerType, out instance); if (ex != null) { throw ex; } lifetimeScope = scope; return(instance); }