Update tbl1 SET tbl1.CoAppEmailAddress = tbl2.PhoneValue From tbl1, tbl3, tbl2 Where tbl3.LeadId = tbl2.EntityContactID AND tbl1.RefNumber = tbl3.ReferenceNbr AND tbl2.PhoneType in ('CoApp Email', 'Email') AND((tbl2.EDDFlag = 0 OR tbl2.EDDFlag is NULL) AND EXISTS(Select 1 from tbl2 where tbl2.EntityContactID = tbl3.LeadId and tbl2.EDDFlag = 1)) and tbl1.LeadId = @LeadId
This query is setting CoAppEmailAddress base on some condition,want to rewrite this query using linq in c sharp,have to taken tbl2 values in list
List
Loading

Rajat JaiswalPosted Jan 4, 2022, 6:24 PM
Hi,
The easiest way you can do this is by SQL To Linq converter tool.
use the following link hope this will help.
http://www.sqltolinq.com/