string sql = $@"SELECT g.GroupID, g.GroupName,ge.EmployeeId,e.employeename FROM dbo.tab_UserGroup g
LEFT JOIN dbo.tab_GroupEmployee ge ON g.GroupId = ge.GroupID
LEFT JOIN dbo.tabEmployee e ON ge.EmployeeId = e.employeeid
WHERE g.EmployeeId = '{user.data.employeeid}'";
var result = db.SqlQueryable<GroupInfo>(sql).ToList();
var items = result.Where((x, i) => result.FindIndex(z => z.GroupID == x.GroupID) == i).ToList();//Lambda表达式去重
Lambda表达式去重
最新推荐文章于 2024-05-30 16:35:55 发布