Join in four tables using LAMBDA

Asked

Viewed 32 times

0

Modelo para o JOIN

I’ve been banging my head for two days to join with LAMBDA on these tables. I am creating a SESSION for my user in ASP.NET Core, before passing my object to JSON, I need to JOIN these tables. However I am not getting, if anyone can help me, I thank you mto. (OBS. I did not post my code, because I am changing it constantly)

1 answer

2


try to make this froma, I do not know how is the name of the tables in your context so you will need to change, but basically this is it

var query =  from o in db.office 
    join e db.employee on x.idOffice equals e.OfficeId
    join a db.address on e.idEmployee equals a.EmployeeId
    join d db.devolution on e.idEmployee equals d.EmployeeId
    where o.idOffice == 1
    select o;

 var result = query.ToList()
  • Man, thanks, I just needed to make some changes and it worked out, thanks

  • For nothing, n forgets to mark as correct the answer and give up vote :)

Browser other questions tagged

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