bool BasesIncludesSelf(ArtefactBase artefact) { foreach (var @base in artefact.Bases) { if (@base.ProperName.Equals(artefact.ProperName)) { return true; } } return false; }
bool ArtefactDerivesFromAnEnclosingScopeArtefact(ArtefactBase artefact, Func<IEnumerable<ArtefactBase>> scopeSelector) { foreach (var baseArtefact in artefact.Bases) { if (ReferenceIsInEnclosingScope(baseArtefact, scopeSelector)) return true; } return false; }