Azure.ApiManagement.IngestTool.ViewModels.SelectApiAppViewModel.OnApiAppSelected C# (CSharp) Method

OnApiAppSelected() private method

private OnApiAppSelected ( ApiAppResource value ) : void
value ApiAppResource
return void
        private async void OnApiAppSelected(ApiAppResource value)
        {
            if (value == null)
                return;

            if (Wizard.Pages.Any(x => x.Legend == Resources.Page1Legend && x.IsSelected))
            {
                using (Context.StartBusyIndicator(Resources.WaitMessageGettingSwagger))
                {
                    using (var httpClient = new HttpClient())
                    {
                        var swaggerJson = await httpClient.GetStringAsync(value.SwaggerUrl);

                        if (!Context.Args.ContainsKey(Constants.CONNECTED_SERVICE_METADATA_KEY_FOR_SWAGGER))
                            Context.Args.Add(Constants.CONNECTED_SERVICE_METADATA_KEY_FOR_SWAGGER, swaggerJson);
                        else
                            Context.Args[Constants.CONNECTED_SERVICE_METADATA_KEY_FOR_SWAGGER] = swaggerJson;
                    }
                }
            }
        }
    }