c# how to get property from object code example
Example 1: c# get object property value by name
return car.GetType().GetProperty(propertyName).GetValue(car, null);
Example 2: c# get property using string
public static object GetPropValue(object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}