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); }
public static bool HasCurrencyRepositoryByISO(string iso) { CurrencyRepository currency = CurrencyRepository.GetCurrencyRepositoryByISO(iso); return(currency != null); }