25
1
using System;
2
using System.Collections.Generic;
3
4
public class Program
5
{
6
public static void Main()
7
{
8
IList<Student> studentList = new List<Student>() {
9
new Student() { StudentID = 1, StudentName = "John" } ,
10
new Student() { StudentID = 2, StudentName = "Steve" } ,
11
new Student() { StudentID = 3, StudentName = "Bill" } ,
12
new Student() { StudentID = 4, StudentName = "Bill" } ,
13
new Student() { StudentID = 5, StudentName = "Ram" } ,
14
new Student() { StudentID = 6, StudentName = "Ron" }
15
};
16
17
Console.WriteLine("Total Students: {0}",studentList.Count);
18
}
19
}
20
21
public class Student
22
{
23
public int StudentID { get; set; }
24
public string StudentName { get; set; }
25
}
Cached Result