I have a Key
object that has an attribute of type List<int>
and it is called KeyProperties
. Key
object also has an int Id
attribute.
class Key
{
public int Id;
public List<int> KeyProperties;
}
I have a list of integers called currentSelection
.
I would like to prevent the user from creating a Key
that has the exact same integers as in currentSelection
. That means if currentSelection
is:
List<int> = new List<int>() {7,8,10};
I do not want the user to create a Key
with a KeyProperties
attribute of (7,8,10). But still the user will be able to create Key
s with (7,8) or (7,8,15).
How can I achieve this using LINQ?