Get property value from string using reflection
Get property value from string using reflection
Get property value from string using reflection
Re: Get property value from string using reflection
```
public static object GetPropValue(object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}
```
Of course, you will want to add validation and whatnot, but that is the gist of it.
public static object GetPropValue(object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}
```
Of course, you will want to add validation and whatnot, but that is the gist of it.