Blackbaud.CustomFx.Currency.Catalog.ExchangeRateRefreshBusinessProcess.LoadActiveCurrencies C# (CSharp) Метод

LoadActiveCurrencies() приватный Метод

private LoadActiveCurrencies ( SqlConnection conn ) : Currency>.IDictionary
conn SqlConnection
Результат Currency>.IDictionary
        private IDictionary<string, Currency> LoadActiveCurrencies(SqlConnection conn)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select");
            sql.AppendLine("  ID,");
            sql.AppendLine("  ISO4217");
            sql.AppendLine("from dbo.CURRENCY");
            sql.AppendLine("where INACTIVE = 0;");

            Dictionary<string, Currency> currencies = new Dictionary<string, Currency>();

            using (SqlCommand cmd = conn.CreateCommand())
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandTimeout = this.ProcessCommandTimeout;
                cmd.CommandText = sql.ToString();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        Guid id = reader.GetGuid(0);
                        string iso = reader.GetString(1);

                        currencies.Add(iso, new Currency { Id = id });
                    }
                }
            }

            return currencies;
        }