static IEnumerable <ICallSite> GetCallSites(IocContainer container, Type expectType) { List <ICallSite> callSites; if (container.FindCallSites(expectType, out callSites)) { foreach (var item in callSites.ToArray()) { yield return(item); } } if (container._hasParent) { foreach (var item in GetCallSites(container.Parent, expectType)) { yield return(item); } } yield break; }