public static void Main()
Entity newEntity = new Entity();
Type entityType = typeof(Entity);
PropertyInfo entityPropInfo = entityType.GetProperty("Address");
Type addressType = entityPropInfo.PropertyType;
PropertyInfo addressPropInfo = addressType.GetProperty("AddressLine1");
var instance = Activator.CreateInstance(addressType);
Console.WriteLine(instance);
addressPropInfo.SetValue(instance, "test");
Console.WriteLine(instance.ToString());
public string Name { get; set; }
public Address Address { get; set; }
public string AddressLine1 { get; set; }