0

I have case statement in my SQL query, i need to convert the same in LinQ statement. I am getting error while converting. Please help.

sum(case when [Filter1].[engagement_phase_id2] = 5 then 1 else 0 end) ClientEngagementPhase,
MannersW
  • 93
  • 9
Sudhanshu Pal
  • 86
  • 1
  • 2
  • 13
  • 1
    See this answer https://stackoverflow.com/questions/936028/linq-case-statement. There is no direct correspondent, but you can use ternary operator – cosmin_popescu Sep 12 '19 at 04:38
  • Have a look at [LINQ Query with both CASE statement and SUM function](https://stackoverflow.com/a/4563122/5519709) – Selim Yildiz Sep 12 '19 at 05:03

0 Answers0