Пример #1
0
 public UpgradesManager(
     AppDbContext dbContext,
     MenuManager menuManager,
     ConfigurationItemManager configurationItemManager,
     ReportsManager reportsManager)
 {
     _dbContext   = dbContext;
     _menuManager = menuManager;
     _configurationItemManager = configurationItemManager;
     _reportsManager           = reportsManager;
     _semVerPattern            = @"^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$";
 }
 public ConsoleManager()
 {
     _menuManager = new MenuManager(_menuItems);
     _menuActions = new Dictionary <int, Action>
     {
         { 1, AddNewCI },
         { 2, AddCIDependency },
         { 3, ListDependencies },
         { 4, UpgradeConfigurationItem },
         { 5, DeprecateConfigurationItem }
     };
     _dbContext         = new AppDbContext();
     _configItemManager = new ConfigurationItemManager(_dbContext, _menuManager);
     _reportsManager    = new ReportsManager(_dbContext, _configItemManager);
     _upgradesManager   = new UpgradesManager(_dbContext, _menuManager, _configItemManager, _reportsManager);
 }
Пример #3
0
        public void DeprecateCI()
        {
            ListItems();
            Console.Write("Specify a CI to deprecate: ");
            string baseCI = Console.ReadLine();

            Console.WriteLine("Before deprecating any CI, it is mandatory that you speak to all the responsible people of the dependant CIs");

            var reports = new ReportsManager(_dbContext, this);

            var found = _dbContext.ConfigurationItems.Find(baseCI.ToUpper());

            var node = reports.BuildNodesForCi(found);

            reports.PrintNodeTree(node);

            Console.ReadKey();
        }