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?

DiplomacyNotWar
  • 31,605
  • 6
  • 57
  • 75
superninja
  • 2,532
  • 7
  • 22
  • 47

0 Answers0