Пример #1
0
        public static CurrencyRepository GetCurrencyRepositoryByISO(string iso)
        {
            CurrencyRepository currency = Assembly.GetExecutingAssembly().GetTypes()
                                          .Where(a => a.GetConstructor(Type.EmptyTypes) != null)
                                          .Select(Activator.CreateInstance).OfType <CurrencyRepository>()
                                          .FirstOrDefault(currency => currency.GetISO().ToLower() == iso.ToLower());

            return(currency);
        }
Пример #2
0
        public static bool HasCurrencyRepositoryByISO(string iso)
        {
            CurrencyRepository currency = CurrencyRepository.GetCurrencyRepositoryByISO(iso);

            return(currency != null);
        }