名单我有List<Student>
过滤通过内部列表键
Student
StudentId
StudentName
List<Subject>
Subject
SubjectId
SubjectName
列表对象我怎样才能List<Student>
通过SubjectId
过滤具有主题返回学生。
我有名单上的
Student1
Math { SubjectId = 1 }
Science { SubjectId = 2 }
Speech { SubjectId = 3 }
Student2
Math { SubjectId = 1 }
Cheering { SubjectId = 4 }
Student3
Science { SubjectId = 2 }
Speech { SubjectId = 4 }
我想SubjectId = 1
过滤上述目的,并希望像
Student1
Math { SubjectId = 1 }
Student2
Math { SubjectId = 1 }
在返回的对象如何查询这在C#?
这看起来更接近我需要的东西,我现在正在测试这一个。 –