public EmployerProviderResult Handle(EmployerProviderRequest request) { var records = _convertFromCsv.CsvTo <EmployerProviderCsvRecord>(LoadEmployerProvidersFromVsts()); _logger.Debug($"Retreived {records.Count} Employer providers", new Dictionary <string, object> { { "TotalCount", records.Count } }); return(new EmployerProviderResult { Providers = records.Select(employerProviderCsvRecord => employerProviderCsvRecord.UkPrn.ToString()).ToList() }); }
public async Task <FcsProviderResult> Handle(FcsProviderRequest message) { var loadProvidersFromVsts = await _vstsClient.GetFileContentAsync($"fcs/{_appServiceSettings.EnvironmentName}/fcs-active.csv"); var records = _convertFromCsv.CsvTo <ActiveProviderCsvRecord>(loadProvidersFromVsts); _logger.Debug($"Retrieved {records.Count} providers on the FCS list", new Dictionary <string, object> { { "TotalCount", records.Count } }); return(new FcsProviderResult { Providers = records.Select(x => x.UkPrn) }); }