I have a class say ClassA which contains a fixed list of students. Lets say we have marked the students if present as true.
public ClassA
{
public List<Student> Students;
}
public Student
{
public bool IsPresent;
}
public bool IsAnythingChanged(classA ModifiedclassA)
{
//Some method we can add to check if any bool value has been changed in List of Students present.
if(ModifiedclassA.SequenceEqual(originalClassAValue))
{
return true;
}
return false;
}
Now suppose one student had attended Lecture1 and after that he left and one more joined. So the state (IsPresent) is changed for those students.
How Can we check if anything has changed in the class.
Previously I was using "SequenceEqual" method to check but that was working for the whole object. Now If I have the same class which contains a List and inside that a boolean property changes , How can I identify.
Remember we have the same object of ClassA.
Aucun commentaire:
Enregistrer un commentaire