I’ve been trying to solve this by reading what was on StackOverflow and the information was quiet helpful but i can’t seem to implement the things i found.
I have a data List and i want to check if an entry exists in the data set that match 2 variables i provide.
public void SaveWaveDataFor( List<WaveData> newData )
{
foreach(WaveData wave in newData)
{
//WaveData item = data.FirstOrDefault( o => o.id == wave.id );
var item = data.Select( o => new{ wave.id, wave.waveNumber } );
Debug.Log( item.id );
}
}
If you want to get all of the
waveobjects that match two criteria, you can use aWhere()clause:The
Select()clause is typically used to transform the matching elements into objects of another type.