示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (GenericType != null ? GenericType.GetHashCode() : 0);
         return(hashCode);
     }
 }
 public bool Equals(HodgepodgeDto o) => o != null &&
 True == o.True &&
 False == o.False &&
 Int8 == o.Int8 &&
 Int16 == o.Int16 &&
 Int32 == o.Int32 &&
 Equals(String, o.String) &&
 Guid.Equals(o.Guid) &&
 IntList.SequenceEqual(o.IntList) &&
 StringArray.SequenceEqual(o.StringArray) &&
 IntPowersArray.SequenceEqual(o.IntPowersArray) &&
 IntStringMap.Count == o.IntStringMap.Count &&
 IntStringMap.All(kvp => o.IntStringMap[kvp.Key] == kvp.Value) &&
 IntStringStringArrayMapArrayMap.Count == o.IntStringStringArrayMapArrayMap.Count &&
 IntStringStringArrayMapArrayMap.All(kvp => {
     var aDicts = kvp.Value;
     var bDicts = o.IntStringStringArrayMapArrayMap[kvp.Key];
     return(aDicts.Length == bDicts.Length &&
            aDicts.Zip(bDicts, Tuple.Create).All(
                (dicts) => {
         var aDict = dicts.Item1;
         var bDict = dicts.Item2;
         return aDict.Count == bDict.Count &&
         aDict.All(innerKvp => bDict[innerKvp.Key].SequenceEqual(innerKvp.Value));
     }));
 }) &&
 Type == o.Type &&
 DateTime == o.DateTime &&
 // ReSharper disable once CompareOfFloatsByEqualityOperator
 Float == o.Float &&
 // ReSharper disable once CompareOfFloatsByEqualityOperator
 Double == o.Double;
示例#3
0
 protected bool Equals(AllTypes <T> other)
 {
     return(Id == other.Id && NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            StringList.EquivalentTo(other.StringList) &&
            StringArray.EquivalentTo(other.StringArray) &&
            StringMap.EquivalentTo(other.StringMap) &&
            IntStringMap.EquivalentTo(other.IntStringMap) &&
            Equals(SubType, other.SubType) &&
            Equals(GenericType, other.GenericType));
 }
示例#4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ (ByteArray != null ? ByteArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CharArray != null ? CharArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LongArray != null ? LongArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubTypes != null ? SubTypes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomText != null ? CustomText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MaxText != null ? MaxText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomDecimal.GetHashCode();
         return(hashCode);
     }
 }
示例#5
0
 protected bool Equals(AllTypes other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Bool == other.Bool &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            ByteArray.SequenceEqual(other.ByteArray) &&
            CharArray.SequenceEqual(other.CharArray) &&
            IntArray.SequenceEqual(other.IntArray) &&
            LongArray.SequenceEqual(other.LongArray) &&
            StringArray.SequenceEqual(other.StringArray) &&
            StringList.SequenceEqual(other.StringList) &&
            StringMap.SequenceEqual(other.StringMap) &&
            IntStringMap.SequenceEqual(other.IntStringMap) &&
            SubType.Equals(other.SubType) &&
            SubTypes.SequenceEqual(other.SubTypes) &&
            CustomText == other.CustomText &&
            MaxText == other.MaxText &&
            CustomDecimal.Equals(other.CustomDecimal));
 }