如何将此请求转换为 Linq 以从表中获取日期和行号?
SELECT ROW_NUMBER() OVER (ORDER BY Date) AS Row,
Date,
WebUrlReferer
FROM [Cnx].[dbo].[Action]
答案 0 :(得分:0)
var query = youContext.Action
.Select((x, i) => new
{
Row = i,
Date = x.Date,
WebUrlReferer = x.WebUrlReferer
})
.OrderBy(x => x.Date);