我有三节课:
public class TestA
{
public string Str1 { get; set; }
public string Str2 { get; set; }
public TestB TestB { get; set; }
public TestA()
{
Str1 = "string1";
Str2 = "string2";
TestB = new TestB();
}
}
public class TestB
{
public string Str3 { get; set; }
public string Str4 { get; set; }
public TestC ObjTestC { get; set; }
public TestB()
{
Str3 = "string3";
Str4 = "string4";
ObjTestC = new TestC();
} …Run Code Online (Sandbox Code Playgroud)