From bceb5640eff2206139b5acbd10d9ab51dbe5a62a Mon Sep 17 00:00:00 2001 From: TypoMustakes Date: Thu, 7 Dec 2023 21:01:32 +0100 Subject: [PATCH] Testing some API calls in Client --- WD7UVN_HFT_2023241.Client/Program.cs | 52 +++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/WD7UVN_HFT_2023241.Client/Program.cs b/WD7UVN_HFT_2023241.Client/Program.cs index 7fa8a6f..3e05b3a 100644 --- a/WD7UVN_HFT_2023241.Client/Program.cs +++ b/WD7UVN_HFT_2023241.Client/Program.cs @@ -1,5 +1,6 @@ -using WD7UVN_HFT_2023241.Models; -using +using System; +using WD7UVN_HFT_2023241.Models; +using System.Collections.Generic; namespace WD7UVN_HFT_2023241.Client { @@ -8,9 +9,50 @@ namespace WD7UVN_HFT_2023241.Client static void Main(string[] args) { RestService rest = new RestService(); - List list = rest.Get("/api"); + + List employeeList = rest.Get("/api/Employee/"); + foreach (Employee e in employeeList) + { + Console.WriteLine( + e.NAME + + ": " + + e.ID + ); + } + + List customerList = rest.Get("/api/Customer/"); + foreach (Customer c in customerList) + { + Console.WriteLine( + c.NAME + + ": " + + c.ID + ); + } + + List maintainerTeamList = rest.Get("/api/MaintainerTeam/"); + foreach (MaintainerTeam m in maintainerTeamList) + { + Console.WriteLine( + m.NAME + + ": " + + m.ID + ); + } + + List serviceList = rest.Get("/api/Service/"); + foreach (Service s in serviceList) + { + Console.WriteLine( + s.NAME + + ": " + + s.ID + + " -> " + + s.IP + + ":" + + s.PORT + ); + } } - - } }