Top "Gethashcode" questions

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

Using GetHashCode for getting Enum int value

I have an enum public enum INFLOW_SEARCH_ON { ON_ENTITY_HANDLE = 0, ON_LABEL = 1, ON_NODE_HANDLE = 2 } // enum INFLOW_SEARCH_…

c# enums gethashcode
Is there a complete IEquatable implementation reference?

Many of my questions here on SO concerns IEquatable implementation. I found it being extremely difficult to implement correctly, because …

c# .net equals gethashcode iequatable
Generate integer based on any given string (without GetHashCode)

I'm attempting to write a method to generate an integer based on any given string. When calling this method on 2 …

c# hash gethashcode
What should GetHashCode return when object's identifier is null?

Which of the following is correct/better, considering that identity property could be null. public override int GetHashCode() { if (ID == …

c# gethashcode iequatable
GetHashCode() with string keys

Hey all, I've been reading up on the best way to implement the GetHashCode() override for objects in .NET, and …

c# .net c#-2.0 gethashcode
How do I create a HashCode in .net (c#) for a string that is safe to store in a database?

To quote from Guidelines and rules for GetHashCode by Eric Lippert: Rule: Consumers of GetHashCode cannot rely upon it being …

c# .net database hashcode gethashcode
What's the best strategy for Equals and GetHashCode?

I'm working with a domain model and was thinking about the various ways that we have to implement these two …

c# .net equals gethashcode
GetHashCode on null fields?

How do I deal with null fields in GetHashCode function? Module Module1 Sub Main() Dim c As New Contact Dim …

null nullreferenceexception equality gethashcode iequatable
What is the difference between using IEqualityComparer and Equals/GethashCode Override?

When i am using dictionaries sometimes I have to change the default Equals meaning in order to compare Keys. I …

c# equals equality gethashcode iequalitycomparer
Creating the GetHashCode method in C#

What is the best way to create your own GetHashCode method for a class in C#? Suppose I have a …

c# .net hashcode gethashcode