I'm using this function :
public static Object GetDate(this Object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}
Suppose a sent propName = "Name" and the src is for example 'Person' object. This function works perfect because return the value returned is the value of field 'Name' in 'Person'. But now I need log on into a property inner other property. For Example, propName = "State.Country.Name"
(State and Country are other objects) Then, if I use the function by passing propName = "State.Country.Name" and src = Person (Persona is a object) the function will be returned the name of the Country?
This works fine: