/// <summary> /// Executes the queries. /// </summary> /// <param name="queries">The queries.</param> public void ExecuteQuery(IEnumerable<IPrescriptionsQuery> queries) { using (var csv = new CsvReader(new StreamReader(prescriptionsCsvFile), fileHasHeaders)) { // Read all the rows while (csv.ReadNextRecord()) { // Get data from row var row = csv.PrescriptionCsvRowToStruct(); // Process this data for each query queries.ForEach(q => q.ProcessRow(row)); } } }
/// <summary> /// Executes the query. /// </summary> /// <param name="query">The query.</param> public void ExecuteQuery(IPrescriptionsQuery query) { using (var csv = new CsvReader(new StreamReader(prescriptionsCsvFile), fileHasHeaders)) { // Read all the rows while (csv.ReadNextRecord()) { // Get data from row var row = csv.PrescriptionCsvRowToStruct(); // Process the data for this query query.ProcessRow(row); } } }