linq左连接
Table1和Table2连接,把Table1的全列出来
var tempData = from a in table1 join b in table2 on a.Id equals b.aId into TempTable from temp in TempTable.DefaultIfEmpty() select new { Program = a.UnitOfBusiness, Tier = a.Tier, Market = a.Market, Id = a.Id, CRM = temo.CRM,//表2的内容 RMShipId =temp.Id //表2的内容
};
temp里面的字段就是b(table2)的字段,select表2的字段就要temp点字段,不能用b点字段,b点不来任何字段