left com linq

07/03/2014

Como eu faço um left nesse linq

from sub2 in db.TB_MENUSUPERIOR_SUBCATEGORIAS2
//join ms in db.TB_MENUSUPERIOR on sub2.id equals ms.Id_SubCategoria2

where sub2.Ativo == 1 && sub2.CdCliente == 1 && sub2.Id_SubCategoria == sub.id
select new {
sub2.id,
sub2.Id_SubCategoria,
sub2.SubCategoria2}

Pjava

Respostas

07/03/2014

Pjava

Resolvido.

from sub2 in db.TB_MENUSUPERIOR_SUBCATEGORIAS2
join ms in db.TB_MENUSUPERIOR on sub2.id equals ms.Id_SubCategoria2 into l

where sub2.Ativo == 1 && sub2.CdCliente == 1 && sub2.Id_SubCategoria == sub.id

from ms in i.DefaultIfEmpty()
select new {
sub2.id,
sub2.Id_SubCategoria,
sub2.SubCategoria2}
Responder Citar