Esempio n. 1
0
        // Add Developer to a team
        private void AddDeveloperToTeam()
        {
            DisplayAllDevelopers();
            Console.WriteLine("Enter the id of the developer you would like to see");
            int input = int.Parse(Console.ReadLine());

            // get developer by id
            Developer dev = _devRepo.GetDeveloperById(input);

            DisplayDevTeams();
            Console.WriteLine($"Enter the name of the team to which you would like to add {dev.Name}");
            string  name = Console.ReadLine();
            DevTeam team = _teamsRepo.GetDevTeamByName(name);
            // AddDevToTeamById returns a string - team not found or added successfully
            string message = _teamsRepo.AddDevToTeamById(dev, team.Name);

            Console.WriteLine(message);
        }