0

Let's say there's a class called Student

public class Student 
{
     public string studentId {get; set;}
     public string Name {get; set;}
     public int age {get; set;} 
}

I want to get the value from the property age in Student object, how do I do that dynamically? As in, I have a string x, and want to get the value from property x in student object, how can I retrieve the value that belongs to property x?

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
superninja
  • 3,114
  • 7
  • 30
  • 63

0 Answers0