I have a bool array that looks like this
bool[] responses = new bool[] {true, false, true};
And two classes that look like this:
public class Person {
public IList<PersonDetail> PersonDetails
}
public class PersonDetail {
public bool Correct { get; set; }
}
PersonDetails
>> PersonDetail[0].correct = true
>> PersonDetail[1].correct = true
>> PersonDetail[2].correct = false
Is there a simple way I can compare these to see if the true/false are equal for each?
I was trying to use the c# .SequenceEqual but I don't know how to get the data from
the PersonDetail class into a sequence xxx that I can use to compare with responses.
Here's what I have so far:
var equal = responses.Select(bool.Parse).SequenceEqual( xxx );
What I need to do is to compare the following:
responses[0] == PersonDetail[0].correct and
responses[1] == PersonDetail[1].correct and
responses[2] == PersonDetail[2].correct
So what's true in responses[x] should match true in PersonDetail[x] and what's false in responses[x] should match false in PersonDetail[x]