<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

JTokenEqualityComparer

Compares tokens to determine whether they are equal.
using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Newtonsoft.Json.Linq { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public class JTokenEqualityComparer : IEqualityComparer<JToken> { public bool Equals(JToken x, JToken y) { return JToken.DeepEquals(x, y); } public int GetHashCode(JToken obj) { return obj?.GetDeepHashCode() ?? 0; } } }