Пример #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>
        /// Compares two JSON PATCH results for equality.
        /// </summary>
        /// <param name="AddOrUpdateResult">A JSON PATCH result to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(AddOrUpdateResult <T> AddOrUpdateResult)

        => IsSuccess.Equals(AddOrUpdateResult.IsSuccess) &&
        Data.Equals(AddOrUpdateResult.Data) &&

        ((!WasCreated.HasValue && !AddOrUpdateResult.WasCreated.HasValue) ||
         (WasCreated.HasValue && AddOrUpdateResult.WasCreated.HasValue && WasCreated.Value.Equals(AddOrUpdateResult.WasCreated.Value))) &&

        ((ErrorResponse.IsNullOrEmpty() && AddOrUpdateResult.ErrorResponse.IsNullOrEmpty()) ||
         (ErrorResponse.IsNotNullOrEmpty() && AddOrUpdateResult.ErrorResponse.IsNotNullOrEmpty() && ErrorResponse.Equals(AddOrUpdateResult.ErrorResponse)));