C# ling to sql 左表连接

  var begin_daily = from a in _postgreDbContext.tab1
                                      join b in _postgreDbContext.tab2 on a.id equals b.merchant_id into a_left
                                      from  left_a in a_left.DefaultIfEmpty()
                                      where left_a.date.ToString("yyyy-MM-dd") == begin_date
                                      select new {
                                        left_a.id,
                                        left_a.balance,
                                        left_a.service_balance,
                                        left_a.paid_money
                                      };
原文地址:https://www.cnblogs.com/personblog/p/11732361.html