我想在View中显示我的Viewbag.studentFaculty
但是当我写@Viewbag.studentFaculty
时我得到了像这样的值 System.Data.Entity.DynamicProxies.Faculty_D453027D6C8963B9EE27305AED88670DD8233614
我的代码
int FGD = db.Students.Where(stu => stu.StudentID == id).Select(f => f.Student_FGD_FK).FirstOrDefault();
Faculty stufac= db.FacultyGovermentDepartments.Where(f => f.FGD_ID == FGD).Select(fac => fac.Faculty).FirstOrDefault();
ViewBag.StudentFaculty = stufac;
答案 0 :(得分:1)
您可以将其存储在变量中:
@ProductName