Answers for "c# how to get property from object"

C#
2

c# get object property value by name

return car.GetType().GetProperty(propertyName).GetValue(car, null);
Posted by: Guest on April-24-2020
0

c# get property using string

public static object GetPropValue(object src, string propName)
 {
     return src.GetType().GetProperty(propName).GetValue(src, null);
 }
Posted by: Guest on July-07-2020

Code answers related to "c# how to get property from object"

C# Answers by Framework

Browse Popular Code Answers by Language