0
在選擇數據,如果我有一個數據這樣的:一組是最新的通過LINQ
UserId/Department/AddedOn
1/IT/2012.10.1
2/IT/2012.11.1
3/Sale/2012.10.2
4/Sale/2012.9.1
我想要得到誰是他們系
var query = _dbConetxt.DepartmentUsers.GroupBy(x=>x.Department)
.Select(x=>new{
x.Key, // this is Department
UserId = null // <--- this is my question, how to get this UserId by lastest AddedOn
});
變種查詢= dbConetxt.GroupBy(X => x.Department) 。選擇(X =>新的{ x.Key, x.UserId }); –