示例#1
0
        private void cmdValue_Click(object sender, EventArgs e)
        {
            SwaggerWebProxyClient proxyClient =
                new SwaggerWebProxyClient(new Uri("http://localhost/SwaggerWebApp"),
                                          new AnonymousCredential());
            var result = proxyClient.Values.GetByid(1);

            MessageBox.Show(result.Value);
        }
示例#2
0
        private void cmdUpdate_Click(object sender, EventArgs e)
        {
            SwaggerWebProxyClient proxyClient =
                new SwaggerWebProxyClient(new Uri("http://localhost/SwaggerWebApp"),
                                          new AnonymousCredential());

            proxyClient.Values.PutByidvalue(1, new ValueObj("New Value"));

            MessageBox.Show("Change Completed!");
        }
示例#3
0
        public async void cmdAllValues_Click(object sender, EventArgs e)
        {
            SwaggerWebProxyClient proxyClient =
                new SwaggerWebProxyClient(new Uri("http://localhost/SwaggerWebApp"),
                                          new AnonymousCredential());
            var result = proxyClient.Values.Get();
            var output = new StringBuilder();

            foreach (var x in result)
            {
                output.AppendLine(x.Value);
            }
            MessageBox.Show(output.ToString());
        }