private void btnServiceQuery_Click(object sender, EventArgs e) { try { var agentGovern = new AgentGovern(); gridService.DataSource = agentGovern.ListServices().Values.ToList(); } catch (Exception exc) { MessageBox.Show(exc.Message); } }
/// <summary> /// List Services /// </summary> static void ListServices() { var agentGovern = new AgentGovern(); var list = agentGovern.ListServices().GetAwaiter().GetResult(); foreach (var item in list) { Console.WriteLine($"{item.Key}"); Console.WriteLine(EntityToString(item.Value)); Console.WriteLine("-----------------------------------------------"); } }