Evidence.GetHashCode Method


Gets a hash code for the Evidence object that is suitable for use in hashing algorithms and data structures such as a hash table.

 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer


A hash code for the current Evidence object.



The following code example shows the use of the GetHashCode method. This example is part of a larger example provided for the Evidence class.

Console.WriteLine(ControlChars.Lf & "Get the hashcode for the evidence.")
Console.WriteLine(("HashCode = " & myEvidence.GetHashCode().ToString()))
Console.WriteLine("\nGet the hashcode for the evidence.");
Console.WriteLine("HashCode = " + myEvidence.GetHashCode().ToString());
Console::WriteLine( "\nGet the hashcode for the evidence." );
Console::WriteLine( "HashCode = {0}", myEvidence->GetHashCode() );


The hash code for two instances of the same evidence might be different, Therefore, hash codes should not be used to compare two Evidence objects.

Applies to