Exemplo n.º 1
0
        private async void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                using (var client = ServicesFactory.CreateForWebRequest <Test.ITestService>("https://127.0.0.1:5001/api/test"))
                {
                    client.DisableSSL = true;

#if (USAGE1)
                    var test1 = await client.Service.Test("ac");

                    var test2 = await client.Service.Test2(new Test.TestData()
                    {
                        test = 12
                    });
#elif (USAGE2)
                    var test1 = await client.Service.Test("ac");

                    var test2 = await client.Service.Test2(new Test.TestData()
                    {
                        test = 12
                    });
#endif
                    label1.Text = $"{test1} {test2.test}";
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }