using System.Collections.Generic;
public static void Main()
List<string> str=new List<string>();
IList<Student> studentList = new List<Student>() {
new Student(){ StudentID=1, StudentName="Bill"},
new Student(){ StudentID=2, StudentName="Steve"},
new Student(){ StudentID=3, StudentName="Ram"},
new Student(){ StudentID=1, StudentName="Moin"}
foreach(var item in studentList)
str.Add(item.StudentName);
Console.WriteLine(str.Count);
public int StudentID { get; set; }
public string StudentName { get; set; }