How do I do this in C#?
using System; namespace TestProperties28373 { class Program { static void Main(string[] args) {
Use reflection :
using System.Reflection; ... PropertyInfo prop = typeof(Customer).GetProperty(propertyName); object value = prop.GetValue(customer, null);
Use System.Reflection and PropertyInfo
System.Reflection