我有班级学生:
public class Student
{
public string Name { get; set; }
public string Age { get; set; }
public Student()
{
}
public List<Student> getData()
{
List<Student> st = new List<Student>
{
new Student{Name="Pham Nguyen",Age = "22"},
new Student{Name="Phi Diep",Age = "22"},
new Student{Name="Khang Tran",Age = "28"},
new Student{Name="Trong Khoa",Age = "28"},
new Student{Name="Quan Huy",Age = "28"},
new Student{Name="Huy Chau",Age = "28"},
new Student{Name="Hien Nguyen",Age = "28"},
new Student{Name="Minh Sang",Age = "28"},
};
return st;
}
}
我怎样才能在这个类中获取数据?(我的意思是 - 示例:我想显示 Name="Minh Sang",Age = "28")。
对不起这个问题。但我不知道在哪里可以找到它。
谢谢大家