API Reference
Class
ObjectDiff
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:
ChangeSetCompares two values: two collections item by item (matched by key), anything else as one object.
Parameters
- before System.Object?
- The old value.
- after System.Object?
- The new value.
- options ConsoleMonster.Changes.DiffOptions? = null
- Options, or null.
Returns
The change set.
public static ChangeSet Compare(IEnumerable<Object?> before, IEnumerable<Object?> after, DiffOptions? options = null) #Returns:
ChangeSetCompares two collections: items are matched by key and compared property by property.
Parameters
- before System.Collections.Generic.IEnumerable<System.Object?>
- The old items.
- after System.Collections.Generic.IEnumerable<System.Object?>
- The new items.
- options ConsoleMonster.Changes.DiffOptions? = null
- 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?
- The old object.
- after System.Object?
- The new object.
- options ConsoleMonster.Changes.DiffOptions? = null
- Options, or null.
Returns
The changes.
public static String Text(Object? value) #Returns:
StringA value as display text: null as empty, collections as {a, b}.
Parameters
- value System.Object?
- The value.
Returns
The text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?