I have been trying to get properties inside a class which implements an interface. My design is as below,
interface ABC
{
string Name { get; set; }
}
public class BCD:ABC
{
public string Name { get; set; }
public string Age{ get; set; }
public string Height{ get; set; }
public string Weight{ get; set; }
}
Now using Reflection I have tried this,
main()
{
ABC abcObj = new BCD();
var typeOfObject = typeof(abcObj);
var objectProperties = typeOfObject.GetProperties(BindingFlags.Public|BindingFlags.Instance);
}
What i got in objectproperties were the properties in the ABC class. However i need the properties from the BCD class too.
Can someone help on this?