コード例 #1
0
        private void AddDevToTeam()
        {
            DevTeam newDevTeam = new DevTeam();


            Console.Clear();
            SeeTeamsList();
            Console.WriteLine("\n Enter which team name you would like to add the developer to: ");
            string teamName = Console.ReadLine();

            Console.Write($" Enter the developer ID to add to {teamName}: ");
            string    devIDToAddToDevList = Console.ReadLine();
            Developer devTeamByID         = _developerRepo.FindDevByID(devIDToAddToDevList);

            newDevTeam.ListOfDevs.Add(devTeamByID);

            bool wasUpdated = _devTeamRepo.UpdateDevTeam(teamName, newDevTeam);

            if (wasUpdated)
            {
                Console.WriteLine("\n Team updated successfully");
            }
            else
            {
                Console.WriteLine("\n Team could not be updated");
            }
        }