How can i convert below sql query into linq?
SELECT
COUNT(CASE WHEN P.Archived = '1' THEN 1 END) As ACount,
COUNT(CASE WHEN P.IsImportant = '1' and P.Archived = '0' THEN 1
END) As ICount,
COUNT(CASE WHEN P.CreatedById = 1389 and P.Archived = '0' THEN 1 END) As CCount,
COUNT(CASE WHEN P.CreatedById != 1389 and P.Archived = '0' THEN 1 END) As SCount,
COUNT(*) as TotalThreatModelsCount
FROM Parties P
This won't result in the same exact query, as it will result in 5 separate queries to the database, but it will give the same results.