Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 7 characters in body; added 13 characters in body
Source Link
czhili
  • 83
  • 1
  • 5

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;Correct { get; set; } } PersonPersonDetails >> 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]

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; } Person >> 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]

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]

Added some formatting into the code, fixed a few definition types.
Source Link

I have a stringbool 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; } Person >> 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.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]responses[x] should match true in PersonDetail[x]PersonDetail[x] and what's false in responses[x]responses[x] should match false in PersonDetail[x]PersonDetail[x]

I have a string 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; } Person >> 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]

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; } Person >> 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]

added 335 characters in body
Source Link
czhili
  • 83
  • 1
  • 5

I have a string 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; } Person >> 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]

I have a string 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; } Person >> 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 ); 

I have a string 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; } Person >> 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]

Source Link
czhili
  • 83
  • 1
  • 5
Loading