我在多天时间里一直在搜索因特网,试图找到我找不到的答案。 我已尝试过对法典的多种改动,结果完全相同。
我建造了两间小班,即“Names”和“Names”学生。 然后,我试图将这两者纳入另一类称为类别名单。 一切都是有益的,直到我把最后一个项目列入议程。 我可以把事情打破,但我会知道我如何能够在“单一”指挥下这样做。 我的印象是,必须这样做,但我对我应该做些什么感到 el。 以前的一切工作:普通静读清单MeadowlarkClasses = 新的()
namespace Testing
{
internal class Testing
{
public class clsStudentName
{
public int? StudentID { get; set; }
public string? StudentFirstName { get; set; }
public string? StudentMiddleInitial { get; set; }
public string? StudentLastName { get; set; }
public clsStudentName()
{
}
public clsStudentName(
int? intStudentID,
string? strStudentFirstName,
string? strStudentMiddleInitial,
string? strStudentLastName)
{
StudentID = intStudentID;
StudentFirstName = strStudentFirstName;
StudentMiddleInitial = strStudentMiddleInitial;
StudentLastName = strStudentLastName;
}
}
public class clsClassName
{
public int? ClassID { get; set; }
public string? ClassName { get; set; }
public clsClassName()
{
}
public clsClassName(
int intClassID,
string strClassName
)
{
ClassID = intClassID;
ClassName = strClassName;
}
}
public class clsClasses
{
public clsClassName? clsClassNm { get; set; } = new clsClassName();
public List<clsStudentName>? clsStudentNames { get; set; } = new List<clsStudentName>();
clsClasses()
{
}
public clsClasses(
clsClassName? ClassNm,
List<clsStudentName>? lstStudentNames
)
{
clsClassNm = ClassNm;
clsStudentNames = lstStudentNames;
}
}
public static readonly clsClassName MathClass = new(
1,
"Math"
);
public static readonly clsClassName ArtClass = new(
2,
"Art"
);
public static readonly clsStudentName AndyApple = new(
1,
"Andy",
"",
"Apple"
);
public static readonly clsStudentName BettyBoo = new(
2,
"Betty",
"",
"Boo"
);
public static readonly clsStudentName CarlCrown = new(
3,
"Carl",
"",
"Crown"
);
public static readonly clsClasses MathClasses = new(
MathClass,
new List<clsStudentName>()
{
AndyApple,
BettyBoo
}
);
public static readonly clsClasses ArtClasses = new(
ArtClass,
new List<clsStudentName>()
{
BettyBoo,
CarlCrown
}
);
private static readonly List<clsClasses> MeadowlarkClasses = new()
{
new()
{
new clsClassName(1, "Math"),
new List<clsStudentName>()
{
new()
{
StudentID = 1,
StudentFirstName = "Mother",
StudentLastName = "Teresa"
},
new()
{
StudentID = 2,
StudentFirstName = "Father",
StudentLastName = "Dowling"
}
}
}
};
}
}
我破碎了事情,试图获得更多的信息,试图在较小的步骤中加以利用,以图示我错做的事情,但我似乎无法找到答案。 我感谢任何人所能提供的任何帮助。