Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hy pleas help me . I cant convert this query to LINQ

SQL
SELECT  dbo.ReportType.name FROM  dbo.Center
INNER JOIN  dbo.SwitchType ON dbo.Center.SwitchTypeID = dbo.SwitchType.SwitchTypeID
RIGHT  JOIN   dbo.ReportType ON dbo.SwitchType.SwitchTypeID = dbo.ReportType.SwitchTypeID
WHERE     (dbo.Center.CenterID = 1) OR (dbo.ReportType.SwitchTypeID IS NULL)
Posted

1 solution

just an assumption, but try splitting it up

var res1 = from t1 in center
join t2 in switchtype on t1.switchtypeid = t2.switchtypeid on j1
from j on j1
join t3 in reporttype on j1.t2.switchtypeid = t3.switchtypeid
where j1.t1.centerid == 1 || j1.t1.sitchtypeid == null
select new { reportname = t3.name
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900