我有一个db结构如下
FeedbackTable
Id
Name
...
...
ProjectApprovalTable
Id
FeedbackId
...
...
我正在将FeedbackDetails
传递给视图。如何在视图中访问projectapproval details
。
这就是我试过的
if (Model.StudentFeedback[i].IsTrainerVerified == true && Model.StudentFeedback[i].StudentProjectApprovals.FirstOrDefault().IsTrainerApproved == false)
{
...
}
我收到错误No Extension Method for FirstOrDefault()
模型类
public partial class StudentFeedback
{
public StudentFeedback()
{
this.StudentProjectApprovals = new HashSet<StudentProjectApproval>();
}
public int Id { get; set; }
....
....
public virtual ICollection<StudentProjectApproval> StudentProjectApprovals { get; set; }
}