Skip to content

DeepEquals Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.ReflectionTools.dll

bool DeepEquals(object objA, object objB, DeepEqualOptions options = null) ​

csharp
bool DeepEquals(object objA, object objB, DeepEqualOptions options = null)

Performs a recursive equality comparison of two objects.

Parameters ​

NameDescription
objAFirst object to compare.
objBSecond object to compare.
optionsOptional comparison options. If null, a new DeepEqualOptions is used.

Returns ​

True if the objects are considered equal by this algorithm; otherwise false.

Remarks ​

Comparison behavior: Reference-equal instances are equal.If either value is null, they are unequal.Primitive types and strings use System.Object.Equals(System.Object). If both values implement IEnumerable, elements are compared in order. When Key is provided, both enumerables are ordered by that property value before comparison.

For other objects, public properties and fields are compared by name and value recursively.

If CompareToString is true, ToString values are compared as a fallback.