Beispiel #1
0
        public async Task <List <Responses.LineChart> > GetAllLineCharts(string currencyId = null, IndicatorType?indicatorType = null, string indicatorId = null, string userId = null)
        {
            // Get all currencies
            var currencies = await _currencyRepository.GetAll(CurrencyExpression.CurrencyFilter(currencyId));

            // Get all indicators
            var indicators = await _indicatorRepository.GetAll(IndicatorExpression.IndicatorFilter(indicatorType, indicatorId, userId));

            // Get all lines
            var lines = await _lineRepository.GetAll(LineExpression.LineFilter(currencyId, indicatorType, indicatorId, userId));

            // Build
            var lineCharts = LineChartBuilder.BuildLineCharts(currencies, indicators, lines);

            // Response
            var response = _mapper.Map <List <Responses.LineChart> >(lineCharts);

            // Return
            return(response);
        }
Beispiel #2
0
        public async Task <List <Responses.Chart> > GetCharts(Period period = Period.ONE_MINUTE, List <string> currencyIds = null, List <string> userIds = null, List <string> indicatorIds = null)
        {
            // Get all currencies
            var currencies = await _mainDbContext.Currencies.Where(CurrencyExpression.Filter(currencyIds)).ToListAsync();

            // Get all indicators
            var indicators = await _mainDbContext.Indicators.Where(IndicatorExpression.Filter(indicatorIds)).ToListAsync();

            // Get all lines
            var lines = await _mainDbContext.Lines.Where(LineExpression.Filter(period, currencyIds, userIds, indicatorIds)).ToListAsync();

            // Build charts
            var charts = ChartBuilder.BuildCharts(currencies, indicators, lines);

            // Response
            var response = _mapper.Map <List <Responses.Chart> >(charts);

            // Return
            return(response);
        }
Beispiel #3
0
        public async Task <List <Responses.Chart> > GetAllCharts(string currencyId = null, IndicatorType?indicatorType = null, string indicatorId = null, string userId = null)
        {
            // Get all currencies
            var currencies = await _mainDbContext.Currencies.Where(CurrencyExpression.CurrencyFilter(currencyId)).ToListAsync();

            // Get all indicators
            var indicators = await _mainDbContext.Indicators.Where(IndicatorExpression.IndicatorFilter(indicatorType, indicatorId, userId)).ToListAsync();

            // Get all lines
            var lines = await _mainDbContext.Lines.Where(LineExpression.LineFilter(currencyId, indicatorType, indicatorId, userId)).ToListAsync();

            // Build
            var charts = ChartBuilder.BuildCharts(currencies, indicators, lines);

            // Response
            var response = _mapper.Map <List <Responses.Chart> >(charts);

            // Return
            return(response);
        }