我有 2 个列表
A = 74137 records (7 columns)
B = 63029 records (5 columns)
并想找到所有的记录
A.column1 = B.column1 and A.column2 = B.column2 and A.column3 = B.column3
但想返回 A 的全部 7 列。到目前为止,我尝试了以下代码:
var ListCucolumn3uriPostale = (from A in _TempListaAdreseInProcesare.AsParallel()
join B in tblcolumn3uri.AsParallel()
on
new { column1 = A.column1.ToUpper(), column2 = A.column2.ToUpper(), column3 = A.column3 }
equals
new { column1 = B.column1.ToUpper(), column2 = B.column2.ToUpper(), column3 = B.column3 }
select new TempSpecificatii
{
column0 = A.column0,
column4 = A.column4,
column1 = B.column1,
column2 = B.column2,
column3 = B.column3,
column5 = B.column5,
column6 = B.column4,
column7 = A.column7,
column8 = A.column8,
column9 = A.column9,
column10 = A.column10
}).ToList();
但我得到了 186395 条记录的列表,这是不正常的。我改变了这样的代码:
var listacucoduripostale = (from A in _TempListaAdreseInProcesare.AsParallel()
select new
{
column1 = A.column1.ToUpper(), column2 = A.column2.ToUpper(), column3 = A.column3
}).Intersect(
from B in tblCoduri.AsParallel()
select new
{
column1 = B.column1.ToUpper(), column2 = B.column2.ToUpper(), column3 = B.column3
}).ToList();
我得到了 23567 条记录的好结果,但列表中只有 3 列,我想要 A 中的所有列。我必须改变什么才能得到想要的结果。谢谢。