/// <summary> /// Resolve multiple types /// </summary> public IEnumerable <object> GetServices(Type serviceType) { if (UnityRegistrationCache.IsRegistered(container, serviceType)) { return(container.ResolveAll(serviceType)); } return(new List <object>()); }
/// <summary> /// Resolve a type /// </summary> public object GetService(Type serviceType) { if (!UnityRegistrationCache.IsRegistered(container, serviceType)) { if (serviceType.IsAbstract || serviceType.IsInterface) { return(null); } } return(container.Resolve(serviceType)); }