这是我的控制器
public ActionResult Index()
{
var data = (from o in db.aspnet_Users
from q in db.aspnet_Profile
where
o.UserId == q .UserId
select new{
o.UserId,
o.UserName,
q.Address,
q.Email,
q.Phone,
q.Mobile,
q.SocialID,
}
).ToList();
ViewData["Allprofile"] = data;
return View();
}
我想在表格的视图中显示数据,在一个视图中显示 2 个 db 模型时出现问题,因为从数据库生成的模型不是 Code First 所以我尝试使用 ViewData 显示数据有什么帮助吗?