Aniket Narvankar

Aniket Narvankar

  • 554
  • 2.1k
  • 608.4k

Converting Sql Union Query to Linq

Jan 21 2022 1:03 PM

How to convert following sql query to linq


SELECT top 1 Id, Name, Address,refNbr FROM tbl1
WHERE Name is not Null and refNbr='abc123'
Union 
select l.Id,a.FirstName a.ResidenceAddress1, l.refNbr from tbl2 l, tbl3 a, 
tbl4 b where b.auto = 1 and 
l.Id = b.Id and l.Id = a.Id and l.refNbr = 'abc123'

Please do let me know how to convert this sql query written using union into linq in c sharp


Answers (3)