Skip to content
ConsoleMonster

API Reference

Class

ObjectDiff

Namespace ConsoleMonster.Changes
Assembly ConsoleMonster
Modifiers static

Compares objects and collections: objects are matched by key, then compared property by property (nested objects by path), giving added, removed and changed objects with counts. Show the result with ChangeView or ask before acting with ChangePreview.

Inheritance

  • Object
  • ObjectDiff

Methods

Compare 2 overloads
public static ChangeSet Compare(Object? before, Object? after, DiffOptions? options = null) #
Returns: ChangeSet

Compares two values: two collections item by item (matched by key), anything else as one object.

Parameters

before System.Object? requiredposition: 0
The old value.
after System.Object? requiredposition: 1
The new value.
options ConsoleMonster.Changes.DiffOptions? = null optionalposition: 2
Options, or null.

Returns

The change set.

public static ChangeSet Compare(IEnumerable<Object?> before, IEnumerable<Object?> after, DiffOptions? options = null) #
Returns: ChangeSet

Compares two collections: items are matched by key and compared property by property.

Parameters

before System.Collections.Generic.IEnumerable<System.Object?> requiredposition: 0
The old items.
after System.Collections.Generic.IEnumerable<System.Object?> requiredposition: 1
The new items.
options ConsoleMonster.Changes.DiffOptions? = null optionalposition: 2
Options, or null.

Returns

The change set.

public static IReadOnlyList<PropertyChange> CompareObjects(Object? before, Object? after, DiffOptions? options = null) #
Returns: IReadOnlyList<PropertyChange>

The changed properties of two objects (nested objects by path, up to DiffOptions.Depth).

Parameters

before System.Object? requiredposition: 0
The old object.
after System.Object? requiredposition: 1
The new object.
options ConsoleMonster.Changes.DiffOptions? = null optionalposition: 2
Options, or null.

Returns

The changes.

public static String Text(Object? value) #
Returns: String

A value as display text: null as empty, collections as {a, b}.

Parameters

value System.Object? requiredposition: 0
The value.

Returns

The text.