/// <summary> /// Find all matching implementations /// </summary> /// <param name="serviceType">Type of service to locate</param> /// <returns>Implementations if found; otherwise an empty collection.</returns> public IEnumerable <object> GetServices(Type serviceType) { if (serviceType == null) { throw new ArgumentNullException("serviceType"); } return(_container.ResolveAll(serviceType)); }
public IEnumerable <TService> ResolveAll <TService>() { return(_container.ResolveAll(typeof(TService)).Cast <TService>()); }
/// <summary> /// Resolve all implementations /// </summary> /// <typeparam name="T">Service that we want implementations for.</typeparam> /// <returns>A collection of implementations; an empty collection if none is found.</returns> public IEnumerable <T> ResolveAll <T>() where T : class { return(_container.ResolveAll <T>()); }