Top "Gethashcode" questions

GetHashCode is method of base Object class of .Net Framework.

Why does C# not implement GetHashCode for Collections?

I am porting something from Java to C#. In Java the hashcode of a ArrayList depends on the items in …

c# java collections hashcode gethashcode
Object.GetHashCode

My question may duplicate Default implementation for Object.GetHashCode() but I'm asking again because I didn't understand the accepted answer …

c# .net hash gethashcode
implement GetHashCode() for objects that contain collections

Consider the following objects: class Route { public int Origin { get; set; } public int Destination { get; set; } } Route implements equality operators. …

c# gethashcode
String.GetHashCode() returns different values

Why is GetHashCode() returning a different value for the same string? I can't describe how to duplicate this, but trust …

c# string .net-4.0 gethashcode
Will string.GetHashCode() return negative value?

I tried with batch of random strings, all values I got are positive, but I wondering: Will String.GetHashCode() return …

c# string hash gethashcode
Overriding GetHashCode for mutable objects?

I've read about 10 different questions on when and how to override GetHashCode but there's still something I don't quite get. …

c# .net overriding equals gethashcode
Why is ValueType.GetHashCode() implemented like it is?

From ValueType.cs **Action: Our algorithm for returning the hashcode is a little bit complex. We look ** for the first …

c# gethashcode
Hibernate n:m extractHashCode throws NullPointerException

I get the following exception while inserting an object with hibernate. Reading from the database works like a charm. I …

mysql hibernate gethashcode composite-primary-key
Does DateTime.Now have its own implementation of GetHashCode that gives unique hashes?

The MSDN article here states, that the default implementation of GetHashCode() does not guarantee unique results and should be not …

c# datetime gethashcode
When Should a .NET Class Override Equals()? When Should it Not?

The VS2005 documentation Guidelines for Overloading Equals() and Operator == (C# Programming Guide) states in part Overriding operator == in non-immutable types …

c# equals gethashcode