有人可以帮我将以下 t-sql 转换为 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