控制器:
public ActionResult Index()
{
var ls = from a in db.A
join b in db.B on a.Id equals b.Id into temp
from tt in temp.DefaultIfEmpty()
select new
{
aname = a.name,
bname = tt.name
};
return View(ls.ToList());
}
在视图中如何引用?
...全文
2797打赏收藏
ASP.NET MVC 自定 LINQ 如何传给视图
控制器: public ActionResult Index() { var ls = from a in db.A join b in db.B on a.Id equals b.Id into temp from tt in temp.DefaultIfEmpty() select new { aname = a.name, bname = tt.name }; return View(ls.ToList()); } 在视图中如何引用?