Я использую SQL код, подобный следующему:
SELECT
LogDate, ID, ActionTypeID, [status]
FROM
(SELECT
rid = ROW_NUMBER() OVER (PARTITION BY ID ORDER BY LogDate DESC), *
FROM table) T
WHERE
rid <= 2
AND ID IN (SELECT ID
FROM table t
WHERE t.LogDate >= '2020-04-15'
AND (t.ActionTypeID = 2 OR t.ActionTypeID = 3))
ORDER BY
LogDate DESC
, но я не знаю, как использовать Linq для SQL.