I want to have LinQ query to filter list collection , when element of child list contains a name . Here child list of parent should be meet the contains criteria and those child list only included with parent list.
Example:
public class Student
{
int Id;
List<subject> SubjectList;
string Name;
}
public class Subject
{
int Id;
string Name;
}
List<Student> studentList = new List<Student>();
Here I want a LINQ query to filter only StudentList of SubjectList, which subject name should be contains "maths" and result must be studentlist with subjectlist, which is only contains maths.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…