Uebungsaufgaben/Semester3/DotNET/Aufgabenblatt7/Aufgabe20/Program.cs
2024-12-19 23:55:07 +01:00

17 lines
542 B
C#

using Aufgabe20;
using Newtonsoft.Json;
var serviceClient = new ServiceReference(@"https://localhost:7267", new HttpClient());
var result = await serviceClient.CustomerAllAsync();
// var responseString = await response.Content.ReadAsStringAsync();
// var customers = JsonConvert.DeserializeObject<List<Customer>>(responseString);
foreach (var customer in result)
{
Console.WriteLine($"\nCustomer {customer.Id}: ");
Console.WriteLine($"{customer.FirstName}");
Console.WriteLine($"{customer.LastName}");
}
Console.ReadLine();