我有一个LINQ等效查询
List<string>
List<string> students;
students.Add("123Rob");
students.Add("234Schulz");
和
Dictionary<string,string>
Dictionary<string, string> courses = new Dictionary<string, string>();
courses .Add("Rob", "Chemistry");
courses .Add("Bob", "Math");
courses .Add("Holly", "Physics");
courses .Add("Schulz", "Botany");
我的目标现在是让一个列表与价值观 - {Chemistry,Botany}
。
换句话说,我试图让LINQ相当于
select value from [courses]
where [courses].key in
(
select [courses].key from courses,students where [students].id LIKE '%courses.key%'
)
应如何LINQ查询被陷害?
[枚举期间的LINQ投射]可能的重复(http://stackoverflow.com/questions/12146296/linq-casting-during-enumeration) –
@LB你错了..这不是一个重复的,请删除dv – GilliVilla