110,538
社区成员
发帖
与我相关
我的任务
分享
var query = tbA.AsEnumerable().Select(p => new
{
id = p.Field<int>("id"),
type = p["type"].ToString(),
uname = string.Empty
}).Concat(tbB.AsEnumerable().Select(p => new
{
id = p.Field<int>("id"),
type = string.Empty,
uname = p.Field<string>("uname")
})).GroupBy(p => p.id).Select(p => new
{
id = p.Key,
type = string.Join("", p.Select(s=>s.type)),
uname = string.Join("", p.Select(s=>s.uname))
});