【发布时间】:2014-10-15 11:06:45
【问题描述】:
net MVC 5 我有一个需要来自两个模型的信息的视图。在一个模型视图中,我有学生标记,在另一个模型视图中,我有学生详细信息如何将两个模型都调用到视图中。
公开课学生 { [钥匙] 公共 int StudentNum { 得到;放; }
public string StudentName { get; set; }
public string StudentSurname { get; set; }
public string Email { get; set; }
}
public class Marks
{
[Key]
public int Mark1 { get; set; }
public int Mark2 { get; set; }
public int Dp { get; set; }
public int StudentNum { get; set; }
public virtual Student Student { get; set; }
}
【问题讨论】: