Last post Oct 09, 2017 02:49 AM by Cathy Zou
Oct 06, 2017 03:04 PM|kanmai|LINK
I have the SQL query .. How to do the same in linq
;WITH cte AS
ROW_NUMBER() OVER (PARTITION BY [SEC_ID] ORDER BY [STDATE] asc) AS rn
WHERE rn = 1
Oct 09, 2017 02:49 AM|Cathy Zou|LINK
You should have something as below:
var query = Posts.GroupBy(p => p.Type)
.Select(g => g.OrderByDescending(p => p.Date)
You also could refer to the links below for better understanding .
You also could use a nice tool for sql to linq trasition.