static async Task MainAsync(string[] args) { DataAccessGeneric checkHomeworks = new DataAccessGeneric(1); List <Student> listOfStudents = await checkHomeworks.getListOfStudentsTask31(); //In case there are no results, print another message if (listOfStudents.Count() == 0 || listOfStudents == null) { Console.WriteLine("There are no elements returned by the exercise"); Console.ReadLine(); } else { //All documents will be displayed foreach (var student in listOfStudents) { Console.WriteLine("Student ID: " + student.Id + ", Name: " + student.Name + ", Score Type: " + student.Grades[2].Type.ToString() + " / Score: " + student.Grades[2].Score); } //Displays answer } }