Exemple #1
0
        public async Task <InitChartDataClientResponse> InitGraph(string clientId = null, string[] assetIds = null)
        {
            var request = new InitChartDataBackendRequest {
                ClientId = clientId, AssetIds = assetIds
            };

            var initChartDataLiveResponse = await _httpRequestService.RequestWithRetriesAsync <InitChartDataBackendResponse>(request, "init.graph");

            return(initChartDataLiveResponse.ToClientContract());
        }
Exemple #2
0
        public InitChartDataBackendResponse InitGraph([FromBody] InitChartDataBackendRequest request)
        {
            var chartData = _micrographCacheService.GetGraphData();

            if (request?.AssetIds?.Length > 0)
            {
                chartData = chartData.Where(d => request.AssetIds.Contains(d.Key))
                            .ToDictionary(k => k.Key, v => v.Value);
            }

            return(BackendContractFactory.CreateInitChartDataBackendResponse(chartData));
        }