Esempio n. 1
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            var result = await ProductApi.GetAllProductsAsync(null);

            if (result != null)
            {
                this.dataGridViewBooks.DataSource = result;
            }
        }
Esempio n. 2
0
        private async void btnGet_Click(object sender, EventArgs e)
        {
            var result = await ProductApi.GetAllProductsAsync(null);

            if (result != null)
            {
                foreach (var item in result)
                {
                    txtLog.Text += item.ID + "\t" + item.Name + "\t" + item.Category + "\t" + item.Price;
                    txtLog.Text += "\r\n";
                }
            }
        }