class CBase
{
object A {get;set;}
object B {get;set;}
}
class CDerived : CBase
{
object X {get;set}
object Y {get;set;}
}
I'm trying to get first level properties. For the example above, intended properties are X and Y, not A and B. With the following code i'm getting all the properties {A,B,X,Y}. Is there any solution without attribute signing.
foreach (var propertyInfo in typeof(CDerived).GetProperties())
{
propertyInfo.SetValue(model, row[propertyInfo.Name], null);
}