Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有学生对象列表
var List<Student> = new List<Student>();
这是学生对象数据(ID,名称)
如何仅使用 Linq To Entities 提取学生 ID 列表
请指教,
只需使用Enumerable.Select:
Enumerable.Select
List<int> studentIDs = students.Select(s => s.ID) .ToList();
(虽然我不确定它与 linq-to-entities 有什么关系)