public static void ResultOfQ1(Dictionary <string, Dictionary <string, Challenge> > uni, UsingMethod <List <Challenge> > method) { ConsoleColor defaultColor = Console.ForegroundColor; UsingMethod <List <Challenge> > um = new UsingMethod <List <Challenge> >(method); List <Challenge> students = um(uni); int i = 0; if (students.Count != 0) { foreach (Challenge k in students) { Console.WriteLine(k); i++; } } else { throw new ArgumentNullException("В коллекции \"Университет\" нет студентов!"); } }
public static void ResultOfQ2(Dictionary <string, Dictionary <string, Challenge> > uni, UsingMethod <int> method) { UsingMethod <int> um = new UsingMethod <int>(method); Console.WriteLine(um(uni)); }