internal static bool KongEquals <T>(this IKongEquatable <T> instance, IKongEquatable <T> other) where T : KongObject
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(instance, other))
            {
                return(true);
            }

            if (other.GetType() != instance.GetType())
            {
                return(false);
            }

            var instanceSerialized = instance.GetEqualityValues().ToNormalizedJson();
            var otherSerialized    = other.GetEqualityValues().ToNormalizedJson();

            return(otherSerialized == instanceSerialized);
        }
 internal static int GetKongHashCode <T>(this IKongEquatable <T> instance) where T : KongObject =>
 instance.GetEqualityValues().ToNormalizedJson().GetHashCode();
示例#3
0
 private static JToken ToDifferenceToken(this IKongEquatable instance) =>
 JToken.FromObject(instance.GetEqualityValues()).Normalize();