linq多表查询?
如下:
var categories =
from p in db.Products
group p by new
{
p.CategoryID,
p.SupplierID
}
into g
select new
{
g.Key,
g
};
再加上一个表 buyer,变成这样:
var categories =
from p in Products
join t0 in buyer on p.bid equals t0.bid into et0
from dt0 in et0.DefaultIfEmpty()
group p by new
{
p.CategoryID,
p.SupplierID,
t0.buyer
} into g
select new
{
g.Key,
g
};
我想要在select new{},再查出buyer中的buyer名称的,,select new{}里头该怎么写?
[解决办法]
g.Key.buyer.Name
[解决办法]