Lets say I have 4 classes
Student { int StudentId, string StudentName, IList<BaseMarks> StudentMarks}
BaseMarks {bool GrandTotalMarks}
SpecializedMarks: BaseMarks {Ilist Results}
Result {string grade, bool Result}
Now, I have a method which populates Students list IList and nested marks collection but typecasts it internally to science marks. I.e. each basemark in Student can be typecasted to ScienceMarks to get practical marks property value.
IList student_List = SomeMethodWhichRetursCollection();
QUESTION How can I filter students who have got "A" grade in any of the subject.
something like:
Students where ((SpecializedMarks)Students.StudentMarks).Result collection. Any of the Grade property's value = "A"