/// <summary> /// Gets all the enrichers that have not been applied to a given target. /// </summary> /// <param name="targetEntityId">Gets the target entity type being enriched.</param> /// <returns></returns> protected virtual IEnumerable <IEnricher <TWhole> > GetEnrichers(string targetEntityId) { var enRepo = new EnricherLogRepository(); var log = enRepo.Get(targetEntityId); foreach (var partDataFile in PartDataDir.GetFiles()) { // this is the source items // load from sources var list = new List <TPart>(); var builder = new CsvEnricherBuilder <TPart, TWhole>() { FilePath = partDataFile.FullName }; var enricher = builder.Get(); if (!log.GetHasBeenProcessed(enricher)) { yield return(enricher); } } }
/// <summary> /// Gets a new instance using a given process configuration operating against a given working folder. /// </summary> public EnricherController(ProcessorConfiguration <TTarget, TTarget> config, string dataDirectory = null) { var processorConfiguration = config; // targetDirectory workingFolder default to current workingFolder DataDir = new DirectoryInfo(dataDirectory ?? Environment.CurrentDirectory); _logRepo = new EnricherLogRepository() { DataDir = DataDir.FullName }; this._entityRules = processorConfiguration.Rules.ToArray(); this._entityCollection = processorConfiguration.CollectionRules.ToArray(); this._flow = new FlowId("FlowABD"); }
protected void AndGivenAnEnrichingController() { this._repo = new EnricherLogRepository(); this._controller = new EnricherProcessor(_repo); }
/// <summary> /// Creates a new instance. /// </summary> public EnricherProcessor(EnricherLogRepository logRepository) { Guard.ArgumentNotNull(logRepository, nameof(logRepository)); _logRepository = logRepository; }