Exemplo n.º 1
0
        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);
        }