❔ Foreach loop

I am trying to run through my list, but nothing is being printed out, what am I doing wrong?
            List<Enrollment> tilmeldingslist = new List<Enrollment>();
            Enrollment enroll1 = new Enrollment(Alex, Programmering);
            Enrollment enroll2 = new Enrollment(Alex, Matematik);
            Enrollment enroll3 = new Enrollment(Alex, Dansk);

            foreach (var items in tilmeldingslist)
            {
                Console.WriteLine(items);
            }
Was this page helpful?