public static void ShowAssignmentsPerStudent() { Console.Clear(); StudentDb sDB = new StudentDb(); AssignmentsPerStudentDb apsDB = new AssignmentsPerStudentDb(); List <Student> students = sDB.GetStudents(); Console.Clear(); if (students.Count != 0) { Console.WriteLine($"Please select a Student to see his Assignments: \n"); ShowList(students, "Students"); bool result = Int32.TryParse(Console.ReadLine(), out int studentID); while (!result || studentID < 1 || studentID > students.Count) { Console.Write($"Wrong input! Please select using numbers from 1 to {students.Count}\n"); result = Int32.TryParse(Console.ReadLine(), out studentID); } Console.Clear(); List <AssignmentPerStudent> assignmentsPerStudent = apsDB.GetAssignmentPerStudent(studentID); ShowList(assignmentsPerStudent, "Assignments"); } else { Console.WriteLine($"There are not Students or Assignments yet"); } }