17 lines
542 B
C#
Raw Normal View History

2024-12-19 23:55:07 +01:00

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();