Your code will work as it is.
Do keep in mind that the
reason it works is because you are comparing Value Types ... Ints ... not Reference Types !
here I am using the same comparison that you use, I've just packaged into a function:
static List<int[,]> list = new List<int[,]>();
int[,] array={{1,1},{2,2}};
public bool isInArray(List<int[,]> list1, int[,] array)
{
foreach (var subArray in list1)
{
if (subArray == array)
{
return true;
}
}
return false;
}
list.Add(array);
bool test = isInArray(list, array);