private async void MainForm_Load(object sender, EventArgs e) { var result = await ProductApi.GetAllProductsAsync(null); if (result != null) { this.dataGridViewBooks.DataSource = result; } }
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"; } } }