I have a class that contains the following two properties:
public int Id { get; private set; }
public T[] Values { get; private set; }
<
Provided that Id and Values will never change, and Values is not null...
public override int GetHashCode()
{
return Id ^ Values.GetHashCode();
}
Note that your class is not immutable, since anyone can modify the contents of Values because it is an array. Given that, I wouldn't try to generate a hashcode using its contents.