Code: Select all
public class BiographicStringType
{
private string valueField;
public string Value
{
get { return valueField; }
set { valueField = value; }
}
}
public class BiographicDataType
{
private BiographicStringType firstNameField;
public BiographicStringType FirstName
{
get { return this.firstNameField; }
set { this.firstNameField = value; }
}
}
public class Person
{
private BiographicDataType biographicsField;
public BiographicDataType Biographics
{
get { return biographicsField; }
set { biographicsField = value; }
}
}
var person = new Person
{
Biographics = new BiographicDataType
{
FirstName = new BiographicStringType
{
Value = "Vasya";
}
}
}
пытаюсь так
Code: Select all
var prop = person.Biographics.GetType().GetProperty("FirstName");
var value = prop.GetType().GetProperty("Value"); // вот тут null