我想加入 2 个表,它们有 2 个相同的列。我已经尝试过了,但在新 {} 等于新 {} 上出现错误。
我的代码:
var results = from table1 in table.AsEnumerable()
join table2 in comment.AsEnumerable()
//Comment
on new {table1.Field<string>("SignalName"), table1.Field<int?>("MessageID")}
equals new {table2.Field<string>("SignalName"), table2.Field<int?>("MessageID")}
into prodGroup
from table3 in prodGroup.DefaultIfEmpty()
select new
{
// something is there
};