How to write this query using lambda Linq in c#

Asked

Viewed 32 times

0

The query I have to pass to lamba is as follows:

select * from Linguagem inner join Cadastro on Lin_ID=Cad_IDLinguagem and Cad_Situation=0

only coonsegui do until the part of the joint but Where do not know what part enters:

return odb.Linguagem.Join(odb.Cadastro, l => l.Lin_ID, c => c.Cad_IDLinguagem, (l, c) => l).ToList();

Thank you very much.

1 answer

1

Hello, try something like this:

odb.Linguagem.Join(odb.Cadastro,
                     l => l.Lin_ID, 
                     c => c.Cad_IDLinguagem,
                     (l, c) => l)
             .Where(x => x.PROPRIEDADE == VERIFICAÇÃO)
         ).ToList();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.