private static void LoadCurrencyPairs(SharedData sharedData) { var filename = AppDomain.CurrentDomain.BaseDirectory + "/StaticData/CurrencyPairs.csv"; var lines = File.ReadAllLines(filename); foreach (var line in lines.Skip(1)) { var parts = line.Split(','); if (parts.Length < 3) { throw new ArgumentException($"File must have at least 3 columns. {filename}"); } sharedData.Set(new CurrencyPair(parts[0], sharedData.Get <Currency>(parts[1]), sharedData.Get <Currency>(parts[2]))); } }