0
I am creating a list within another one as follows:
var playerGames01 = new ObjectGamePlayerMoviments();
playerGames01.Game = new List<Games>()
{
new Games
{
PlayerMoviment = new List<PlayersMoviments>()
{
new PlayersMoviments {
Name = "Armando",
Moviment = "P"
},
new PlayersMoviments {
Name = "Dave",
Moviment = "S"
}
}
}
};
And when I try to perform a select to find out if there are different movements of P,R ou S
, he always returns to me that there is 1.
What am I doing wrong ?
var verifyChoice = game.Game.Select(x => x.PlayerMoviment.Select(y => y.Moviment != "P" && y.Moviment != "S" && y.Moviment != "R"));
It returns as in the image below:
Which [is the one that selects?
– Maniero
@Maniero put picture in question. The problem is that it returns Empty and consequently takes the value
1,
I’m comparing it to0
, if I change the comparison to1
, when I have real value he’ll let it go.– Matheus