public async Task <IActionResult> LoadCandles([FromQuery] string fromSymbol, string toSymbol, string exchange)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            await _importMetaDataService.ImportAllMinutePairCandles(fromSymbol, toSymbol, exchange);

            stopwatch.Stop();
            return(Ok($"Total time = {stopwatch.ElapsedMilliseconds / 1000}"));
        }
        public async Task ImportAllMinutePairCandles(string from, string to, string exchange)
        {
            using (var cntx = Context())
            {
                Currency currency = new Currency
                {
                    Symbol = from
                };
                cntx.Currencies.Add(currency);
                cntx.SaveChanges();
            }

            using (var cntx = Context())
            {
                Currency currency = new Currency
                {
                    Symbol = to
                };
                cntx.Currencies.Add(currency);
                cntx.SaveChanges();
            }

            using (var cntx = Context())
            {
                Exchange ex = new Exchange
                {
                    Name = exchange
                };
                cntx.Exchanges.Add(ex);
                cntx.SaveChanges();
            }

            using (var cntx = Context())
            {
                ExchangePair exchangePair = new ExchangePair
                {
                    CurrencyFromId = cntx.Currencies.FirstOrDefault(c => c.Symbol == from).Id,
                    CurrencyToId   = cntx.Currencies.FirstOrDefault(c => c.Symbol == to).Id,
                    ExchangeId     = cntx.Exchanges.FirstOrDefault(c => c.Name == exchange).Id,
                };
                cntx.Pairs.Add(exchangePair);
                cntx.SaveChanges();
            }

            Parallel.For(0, 1000, async(i) =>
            {
                await _coldImportTests.ImportAllMinutePairCandles(from, to, exchange);
            });

            var  context = Context();
            bool isAll60 = await context.Candles.AllAsync(x => x.Interval == 60);

            bool isAllMatch = await context.Candles
                              .Include(x => x.ExchangePair)
                              .AllAsync(x => x.ExchangePair.CurrencyFrom.Symbol == from &&
                                        x.ExchangePair.CurrencyFrom.Symbol == to &&
                                        x.ExchangePair.Exchange.Name == exchange);

            Assert.True(isAll60);
            Assert.True(isAllMatch);
        }