Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
 public CoinInfoGrabTask(
     ICoinInfoService coinInfoService,
     IOptions <SiteSettings> options)
 {
     _coinInfoService = coinInfoService;
     _options         = options;
 }
Exemplo n.º 3
0
 public TelegramBotTask(
     ITelegramBotService telegramBotService,
     ICoinInfoService coinInfoService,
     IOptions <SiteSettings> options)
 {
     _telegramBotService = telegramBotService;
     _coinInfoService    = coinInfoService;
     _options            = options;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 币币信息
 /// </summary>
 /// <param name="service">ICoinInfoService</param>
 public CoinInfoController(ICoinInfoService service)
 {
     _service = service;
 }
Exemplo n.º 5
0
 public CoinsController(
     ICoinInfoService coinInfoService)
 {
     this.coinInfoService = coinInfoService;
 }