예제 #1
0
        /// <summary>
        /// Compares two JSON PATCH results for equality.
        /// </summary>
        /// <param name="PatchResult">A JSON PATCH result to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(PatchResult <T> PatchResult)

        => IsSuccess.Equals(PatchResult.IsSuccess) &&
        PatchedData.Equals(PatchResult.PatchedData) &&

        ((ErrorResponse.IsNullOrEmpty() && PatchResult.ErrorResponse.IsNullOrEmpty()) ||
         (ErrorResponse.IsNotNullOrEmpty() && PatchResult.ErrorResponse.IsNotNullOrEmpty() && ErrorResponse.Equals(PatchResult.ErrorResponse)));
예제 #2
0
        /// <summary>
        /// Return the hash code of this object.
        /// </summary>
        /// <returns>The hash code of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(IsSuccess.GetHashCode() * 5 ^
                       PatchedData.GetHashCode() * 3 ^

                       (ErrorResponse.IsNotNullOrEmpty()
                           ? ErrorResponse.GetHashCode()
                           : 0));
            }
        }