How to convert following sql query to linq to sql?
select c.ClientID , c.ClientName , case when cca.clientID >0 then 1 else 0 end 'ClientAccess' from Clients c
left join clientcontactaccess cca ON cca.clientid = c.ClientID and cca.ClientContactID = 2141
where c.GroupID = 1
I have done this so far but don't know how to handle "and cca.ClientContactID = 2141" condition;
dynamic query = (from c in db.Clientdb.ClientContactAccesscca.ClientIDc.ClientIDGroupfrom cca in GroupDetails.DefaultIfEmpty()where c.GroupID == 1c.ClientIDc.ClientNamecca.ClientID.ToString == null ? 0 : 1);