I can’t work out how to convert this into Linq. Any help appreciated!
SELECT distinct top 5 searchterm, created
FROM
( SELECT searchterm, created ,ROW_NUMBER()
over(partition by searchterm order by created) Ordresults, createdby
FROM searchhistory
) A
WHERE A.Ordresults = 1 and A.CreatedBy = 'USERNAME'
ORDER BY A.Created DESC
Something like this should work:
Query syntax:
Takeis not supported, so it has to be called as an extension method:Method syntax: