Answers for "C# get property from object by string"

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# get property from object by string"

C# Answers by Framework

Browse Popular Code Answers by Language