public void ErasingImpact() { _consoleManager.Header("Check impact of deleting a CI"); _configItemManager.MicroTableList(); Console.Write("Write name of node: "); string name = Console.ReadLine()?.ToUpper(); var foundCi = _dbContext.ConfigurationItems.Find(name); if (foundCi == null) { _consoleManager.PressAnyKeyMessage("CI was not found in the system..."); _consoleManager.LoadFirstScreen(); } Console.WriteLine("HIERARCHY"); CINode node = BuiildNodesForCI(new CINode { Value = foundCi }); PrintNodeToEraseForCi(node); Console.WriteLine(); _consoleManager.PressAnyKeyMessage(); _consoleManager.LoadFirstScreen(); }
public void TableList() { Table table = new Table(); table.SetHeaders("Name", "Description", "Responsible", "Version", "Dependencies"); var cis = _dbContext.ConfigurationItems.Include(ci => ci.DependencyItems).ToHashSet(); foreach (ConfigurationItem ci in cis) { table.AddRow(ci.Name, ci.Description, ci.Responsible, ci.Version, ci.DependencyItems.Count().ToString()); } _consoleManager.Header("List of Configuration Items"); string tableString = table.ToString(); Console.WriteLine(tableString); _consoleManager.PressAnyKeyMessage(); GoBack(); }