Add project files.
This commit is contained in:
26
WinForms/EmployeeDirectory.cs
Normal file
26
WinForms/EmployeeDirectory.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using WinForms.Models;
|
||||
|
||||
namespace WinForms
|
||||
{
|
||||
public partial class EmployeeDirectory : Form
|
||||
{
|
||||
public EmployeeDirectory()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void EmployeeDirectory_Load(object sender, EventArgs e)
|
||||
{
|
||||
using var client = new HttpClient();
|
||||
var results = await client.GetFromJsonAsync<List<EmployeeModel>>("https://localhost:7126/employees");
|
||||
employeeList.DataSource = results;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user