public CountyCode CountiesLookup(string data) { CountyCode info = null; counties.TryGetValue(data.ToUpper(), out info); return(info); }
public override void Setup() { var InputFilePath = GetSrcPath("Data", "CountryMap.csv"); counties = new Dictionary <string, CountyCode>(); using (var reader = new StreamReader(InputFilePath)) using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture)) { csv.Configuration.PrepareHeaderForMatch = (string header, int index) => header.ToLower(); var records = csv.GetRecords <CountyCodeDTO>(); records.ToList().ForEach(cc => counties.Add(cc.alpha_3, CountyCode.Parse(cc))); } }