public IEnumerable <String> ExtractCodes( SecurityRepository securityRepository, String portfolioId, ManagingPst.PortfolioSecurityTargetRepository portfolioSecurityTargetRepository, ISecurityIdToPortfolioIdResolver securityToPortfolioResolver ) { var traverser = new TargetsTraverser <Object>( (whatever, target) => target, // we don't change targets (whaterer, target) => whaterer // we don't change the state ); var flatTargets = traverser.Traverse( portfolioId, portfolioSecurityTargetRepository, new Object(), new HashSet <String>(), securityToPortfolioResolver ); var results = flatTargets.GroupBy(x => securityRepository .GetSecurity(x.SecurityId) .AsCompanySecurity() // <---- at this level (very bottom) all securities have to be company securities (there must be no funds at this level) .Country.IsoCode ).Select(x => x.Key).ToArray(); return(results); }
public TargetsFlattener(InfoCopier copier) { this.copier = copier; this.traverser = new TargetsTraverser <State>( this.FlatTarget, this.DrillState ); }