我是一位经验丰富的.NET C#软件开发人员,但仅在几个月前我开始使用MVC Razor(MVC 5).
我有一个小情况,我在网上找不到任何答案(搜索后数小时)
我有一个模型,其中包含另一个模型的列表,该模型又具有如下所示的模型列表.
public class Parent
{
public string Name { get; set; }
public string Sex { get; set; }
public int Age { get; set; }
public List<Child> Children { get; set; }
}
public class Child
{
public string Name { get; set; }
public string Sex { get; set; }
public int Age { get; set; }
public List<GrandChild> GrandChildren { get; set; }
}
public class GrandChild
{
public string Name { …Run Code Online (Sandbox Code Playgroud)