日期:2014-05-20 浏览次数:21001 次
var result=from x in list1.Select((a,i)=>new {a,i})
join y in list2.Select((a,i)=>new {a,i})
on x.i equals y.i into t
from y in t.DefaultIfEmpty()
select new {key=x.a,value=y==null?"":y.a};
var list1 = new List<string>() { "AA","BB",};
var list2 = new List<string>() { "Q"};
new { key="AA",Value="Q"}
new { key="BB",Value=""}