编辑
根据评论,您想将其加入一个名为 output 的实体中,因此您可以在匿名类型的帮助下完成并加入
var data = from c in customer
join p in person
on p.ID equals c.ID
select new
{
PersonName = p.Name,
CustomerName - c.Name
PersonAdd = p.Add
CustomerAdd = c.Add
};
加入将像这样工作
检查更多细节:SQL to LINQ (Visual Representation)
var data = from c in customer
join p in person
on p.ID equals c.ID
select c;
图像预设
或者
Linq加入多列
var cust = from c in Customers
join p in persons on
new { Name= c.Name, Address= c.Address }
equals
new { Name= p.Name, Address= p.Address }
select c;