I have never used before Linq, and really have lack of time to study. My little knowledge is not enough to do this and I need your help. Here is a code which I need to convert into Linq. (I am using EF6 and context)
WITH messages AS (
SELECT s.siteId,s.originator,s.sentTime,s.mode,s.mainsFrequency,s.gensetFrequency,
s.dgBattery,s.runHours,s.fuel,s.messageID,s.messageText,
ROW_NUMBER() OVER(PARTITION BY s.originator
ORDER BY s.sentTime DESC) AS rk
FROM smsParseds s)
SELECT m.*
FROM messages m
WHERE m.rk = 1
order by m.sentTime DESC