get property of an object c# code example
Example 1: c# get type of object
//Exact runtime type of the current instance.
object.GetType();
Example 2: how to get value from object in c#
var nameOfProperty = "property1";
var propertyInfo = myObject.GetType().GetProperty(nameOfProperty);
var value = propertyInfo.GetValue(myObject, null);