Hi,
I have a pretty complex object and I need to get uniqueness of these objects. One solution can be done by overriding GetHashCode()
. I have implemented a code noted below:
public override int GetHashCode()
{
return this._complexObject1.GetHashCode() ^
this._complexObject2.GetHashCode() ^
this._complexObject3.GetHashCode() ^
this._complexObject4.GetHashCode() ^
this._complexObject5.GetHashCode() ^
this._complexObject6.GetHashCode() ^
this._complexObject7.GetHashCode() ^
this._complexObject8.GetHashCode();
}
These complex objects also overrides GetHashCode()
and does similar operations.
My project requires uniqueness of these objects which I deal with these very frequently, and data inside also changes in various ways and places.
I need a faster way to find uniqueness of these complex objects, which need to consider performance and memory.
Thanks in advance
Munim