Can someone please help me convert the following t-sql into c# linq?
select
clientid,
orderId
from
(
select
row_number() over (partition by clientid order by purchasedate desc) as rownum,
clientid,
id as orderId
from ordertraining
) as x where rownum = 1