public void SaveResultsToDirectory(ResultHistory theResults, string directory) { var system = new FileSystem(); system.ClearFolder(directory); theResults.Each((path, result) => { result.Locator = path; string filename = FileNameFor(path); filename = Path.Combine(directory, filename); system.PersistToFile(result, filename); }); }