public CoinRepository(ICoinGeckoClient coinGeckoClient, IMemoryCache memoryCache, ICoinLogger coinLogger) { coinLogger.Log($"Initializing {nameof(CoinRepository)}."); _coinGeckoClient = coinGeckoClient; _memoryCache = memoryCache; _coinLogger = coinLogger; _coins = CoinData.GetAllCoins().Where(x => x.MarketCapRank > 0).GroupBy(x => x.Symbol).Select(x => x.OrderBy(y => y.MarketCapRank).First()).ToList(); _coinBySymbolLookup = _coins.ToDictionary(x => x.Symbol, x => x); }
public CoinFunctions() { _coinRepository = new CoinRepository(); _logger = new CoinLogger(); }
public CoinFunctions(ICoinRepository coinRepository, ICoinLogger logger) { _coinRepository = coinRepository; _logger = logger; }