public void Run() { foreach (var document in documentsSource.GetDocuments()) { documentProcessor.Process(document); } }
public InputDocument[] GetDocuments() { var allDocuments = decoratedDocumentsSource.GetDocuments(); HashSet <string> processedDocuments; using (var context = dataContextFactory.Create()) { processedDocuments = new HashSet <string>(context.Documents.Select(x => x.Name)); } return(allDocuments.Where(x => !processedDocuments.Contains(x.DocumentName)).ToArray()); }