public static async Task InitSymbols( ApplicationDbContext context, ICoinInfoService coinInfoService) { if (!context.Symbols.Any()) { var grabbedItems = await coinInfoService.GetExchangeSymbols(); var symbols = grabbedItems.Select( e => new Symbol { GlobalSymbol = e.GlobalSymbol, Bittrex = e.Bittrex, HitBtc = e.HitBtc, Yobit = e.Yobit, KuCoin = e.KuCoin, Cryptopia = e.Cryptopia, Binance = e.Binance }); await context.Symbols.AddRangeAsync(symbols); await context.SaveChangesAsync(); } }
public CoinInfoGrabTask( ICoinInfoService coinInfoService, IOptions <SiteSettings> options) { _coinInfoService = coinInfoService; _options = options; }
public TelegramBotTask( ITelegramBotService telegramBotService, ICoinInfoService coinInfoService, IOptions <SiteSettings> options) { _telegramBotService = telegramBotService; _coinInfoService = coinInfoService; _options = options; }
/// <summary> /// 币币信息 /// </summary> /// <param name="service">ICoinInfoService</param> public CoinInfoController(ICoinInfoService service) { _service = service; }
public CoinsController( ICoinInfoService coinInfoService) { this.coinInfoService = coinInfoService; }