17 lines
542 B
C#
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(); |