I am trying get type of property of my class by using of reflection but its returning my only RuntimePropertyInfo - as a name of a type.
I have object MyObject actua
You're getting the type of the PropertyInfo
object getProperty()
returns. Try
string typeName = actualData.getType().getProperty("Item").PropertyType.Name;
If you want the type of the value currently assigned to the object via the PropertyInfo
object, you could call:
string typeName = actualData.getType().getProperty("Item").GetValue(actualData, null).GetType().Name;
But in that case you could also simply call:
string typeName = actualData.Item.GetType().Name;