예제 #1
0
    public int HashHelpers()
    {
        var hash = Property1.GetHashCode();

        hash = Combine(hash, Property2?.GetHashCode(StringComparison.Ordinal) ?? 0);
        hash = Combine(hash, Property3.GetHashCode());
        hash = Combine(hash, Property4);
        return(hash);
    }
예제 #2
0
            public override int GetHashCode()
            {
                int hash = 13;

                hash = (hash * 7) + Property1.GetHashCode();
                hash = (hash * 7) + Property2.GetHashCode();
                hash = (hash * 7) + Property3.GetHashCode();
                return(hash);
            }
예제 #3
0
 public int ReSharper()
 {
     unchecked
     {
         var hash = Property1.GetHashCode();
         hash = (hash * 397) ^ (Property2?.GetHashCode(StringComparison.Ordinal) ?? 0);
         hash = (hash * 397) ^ Property3.GetHashCode();
         hash = (hash * 397) ^ Property4;
         return(hash);
     }
 }
예제 #4
0
            public override int GetHashCode()
            {
#if NET461 || NETSTANDARD2_0
                var hashcode = 35203352;
                var offset   = -1521134295;
                hashcode *= offset + Property1.GetHashCode();
                hashcode *= offset + Property2.GetHashCode();
                return(hashcode);
#else
                return(HashCode.Combine(Property1, Property2));
#endif
            }
예제 #5
0
 public override int GetHashCode()
 {
     return(Property1.GetHashCode()); // minimal but sufficient
 }
예제 #6
0
 public override int GetHashCode()
 {
     return(Property1.GetHashCode());
 }
예제 #7
0
 public override int GetHashCode()
 {
     return(HashCode.Aggregate(Property1.GetHashCode(), Property2.GetHashCode()));
 }