I have class student :
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;
}
}
How can I take data in this class? ( I mean – example : I want take Name=”Minh Sang”,Age = “28” to show).
sorry about this question. but i don’t know where to find it.
thanks all
EDIT 1:
Add these methods to your class:
intif you need to evaluate in future>or<.EDIT 2:
Then invoke the methods like this: