Skip to content
Advertisement

Join multiple columns from the same table using Linq

I would like to convert following sql query into Linq to SQL

going through this I have so far tried following which didn’t work out

Edit: following query is being generated against Svyatoslav Danyliv answer which is returning 7 rows instead of 6

Advertisement

Answer

Join which contains not just AND expressions is possible via from x in entities.Where(x => ..). You have did that partially and made mistake in where condition.

Corrected query, looks the same as original SQL

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement