Ejemplo n.º 1
0
        public async Task <AverageSizes> getAverages(int seconds, IJSRuntime jSRuntime)
        {
            string serverUrl = Configuration["ServerUrl"];

            controllerUrl = $"{serverUrl}api/BookColumns/";

            await Task.Yield();

            AverageSizes values = new AverageSizes();

#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "new AverageSizes");
#endif

            var url = $"{controllerUrl}getLtAverages/{seconds}";
            try
            {
                values = await Http.GetFromJsonAsync <AverageSizes>(url);
            }
            //catch { }
            catch (System.Exception ex)
            {
                throw new System.Exception($"Check that tapeStream Server {controllerUrl} is running.", ex);
            }
#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "AverageSizes values");
#endif

            return(values);
        }
Ejemplo n.º 2
0
        public async Task <AverageSizes> getLtRatios(int seconds, IJSRuntime jSRuntime)
        {
            string serverUrl = Configuration["ServerUrl"];

            controllerUrl = $"{serverUrl}api/BookColumns/";

            await Task.Yield();

            AverageSizes values = new AverageSizes();

#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "new AverageSizes");
#endif
            try
            {
                values = await Http.GetFromJsonAsync <AverageSizes>($"{controllerUrl}getLtRatios/{seconds}");
            }
            catch { }

#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "AverageSizes Ratios values");
#endif

            return(values);
        }