Можно ли преобразовать следующий запрос в ICriteria или LINQ, и если да, то как?
SELECT Test.personid
FROM
(
SELECT r.PersonId AS personid, e.ActivityId
FROM Event e
INNER JOIN Registration r ON e.Id = r.EventId
WHERE e.ActivityId IN (1, 2)
GROUP BY r.PersonId, e.ActivityId
) AS Test
GROUP BY Test.personid
HAVING COUNT(Test.ActivityId) >= 2