How to make a right join using LINQ to SQL & C#?

后端 未结 2 1118
野趣味
野趣味 2020-12-06 19:07

I have a problem creating the following SQL Statement using LINQ & C#

    select c.IDAddenda, c.Descripcion
      from CatAddendas c 
right join EmpresaAd         


        
2条回答
  •  余生分开走
    2020-12-06 19:35

     var RightJoin = from adds in dc.EmpresaAddendas
                     join cats in CatAddendas 
                         on adds.IDAddenda equals cats.IDAddenda into joined
                     from cats in joined.DefaultIfEmpty()
                     select new
                     {
                         Id = cats.IDAddenda,
                         Description = cats.Descripcion 
                     };
    

提交回复
热议问题