Could you help me convert this SQL statement to Linq?
I have done an IN before but the GROUP BY, ORDER BY and TOP are parts I haven’t done before.
SELECT TOP 300 lower(UserName) FROM UserHistory
WHERE LOWER(UserName) IN (SELECT Lower(UserName) FROM ActiveUsers)
GROUP BY LOWER(UserName)
ORDER BY MAX(Date) DESC
GROUP BY is done in Linq by:
ORDER BY is done in Linq by:
or
TOP is done in Linq by:
NOTE: the arguments are not strings, just a way to say you have to put the correct value there.