Пример #1
0
        async Task Load(int id)
        {
            // Get a test from the API
            AVTestData aVTestData = await TJBarnesService.GetHttpClient()
                                    .GetFromJsonAsync <AVTestData>("api/avtests/" + id.ToString());

            // Use the Deserializer method of the JsonSerializer class (in the System.Text.Json namespace) to create
            // a BlowCore object
            BlowCore blowCore = JsonSerializer.Deserialize <BlowCore>(aVTestData.AVTestSpec);

            // Now create a Blow object from the BlowCore object
            blow = new Blow();
            blow.LoadBlow(blowCore);

            blow.BellColor = Constants.UnstruckTestBellColor;

            testSpec.ShowGaps = false;
            StateHasChanged();
        }