BuildIt.Autofac.AutofacServiceLocator.DoGetAllInstances C# (CSharp) Méthode

DoGetAllInstances() protected méthode

Resolves all requested service instances.
/// Thrown if is . ///
protected DoGetAllInstances ( Type serviceType ) : IEnumerable
serviceType System.Type Type of instance requested.
Résultat IEnumerable
        protected override IEnumerable<object> DoGetAllInstances(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }
            var enumerableType = typeof(IEnumerable<>).MakeGenericType(serviceType);

            object instance = container.Resolve(enumerableType);
            return ((IEnumerable)instance).Cast<object>();
        }
    }