// Finds all mappings provided by instances implementing IMappingStrategyFactory. // The strategies provided by a factory often are MappingDelegateStrategy // instances that provides a non-custom mapping delegating to an open-source // library. private IEnumerable <TargetMap> GetFactoryProvidedMappingStrategies() { return(StrategyFactories .SelectMany(f => f.GetStrategies()) .Select(s => new TargetMap { StrategyInstance = s, SourceType = s.SourceType, TargetType = s.TargetType })); }
// Finds all mappings provided by instances implementing IMappingStrategyFactory. // The strategies provided by a factory are usually MappingDelegateStrategy // instances that provides non-custom mapping and delegate to an open-source // library. private TargetMap[] GetFactoryProvidedMappingStrategies() { TargetMap[] targetMappings = StrategyFactories .SelectMany(f => f.GetStrategies()) .Select(s => new TargetMap { StrategyInstance = s, SourceType = s.SourceType, TargetType = s.TargetType }).ToArray(); return(targetMappings); }