Skip to content
ConsoleMonster
Class

DiffOptions

ConsoleMonster.Changes

Namespace
ConsoleMonster.Changes
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

Options for ObjectDiff.

Inheritance

  • object
  • DiffOptions

Usage

Explore 55 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 29

Constructors

public DiffOptions() #

Properties

public IList<string> Key { get; } #

The members whose values identify an object (like Compare-Object -Property for matching). Empty: Id, Name, Key...

public Func<object, object?>? KeySelector { get; set; } #
Fluent("KeyBy")

A function that returns an object's key, instead of DiffOptions.Key.

public IList<string> Properties { get; } #

The members to compare, or empty for all of them.

public IList<string> Ignore { get; } #

Members (or paths such as Address.City, with * wildcards) left out of the comparison.

public int Depth { get; set; } #

How deep nested objects are compared (default 3).

public bool IncludeUnchanged { get; set; } #

Whether unchanged objects are listed too (they are always counted).

public Func<object, object>? Unwrap { get; set; } #
Fluent("UnwrapBy")

Turns a host wrapper into the value to compare (for example a PowerShell object around a dictionary), or null.

public TimeSpan TimeBudget { get; set; } #

How long getters may stall in one comparison before slow members stop being read (default 2 seconds).

public bool CaseSensitive { get; set; } #

Compare string values and match keys with ordinal case sensitivity. Default false.

public object? Baseline { get; set; } #

The baseline column's zero-based int index or unique string name. Null selects the first column; numeric strings remain names.

public IDictionary<string, Func<object?, object?>> Normalize { get; } #

Comparison-only transforms keyed by exact property path (case-insensitive lookup). Display keeps original values.

public IList<IMemberSource> Sources { get; } #

Member sources tried before reflection (PowerShell objects, dictionaries, JSON).

Extension Methods

public static DiffOptions Baseline(DiffOptions diffOptions, object? value) #

Sets DiffOptions.Baseline: The baseline column's zero-based int index or unique string name. Null selects the first column; numeric strings remain names.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value object? required
The value.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { Baseline = value };    diffOptions.Baseline(value);
public static DiffOptions CaseSensitive(DiffOptions diffOptions, bool value = true) #

Sets DiffOptions.CaseSensitive: Compare string values and match keys with ordinal case sensitivity. Default false.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                                // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { CaseSensitive = value };    diffOptions.CaseSensitive(value);
public static DiffOptions Depth(DiffOptions diffOptions, int value) #

Sets DiffOptions.Depth: How deep nested objects are compared (default 3).

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value int required
The value.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { Depth = value };    diffOptions.Depth(value);
Ignore 2 overloads
public static DiffOptions Ignore(DiffOptions diffOptions, string item) #

Adds an item to DiffOptions.Ignore: Members (or paths such as Address.City, with * wildcards) left out of the comparison.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
item string required
The item.

Returns

DiffOptions The same instance.
public static DiffOptions Ignore(DiffOptions diffOptions, IEnumerable<string> items) #

Adds items to DiffOptions.Ignore: Members (or paths such as Address.City, with * wildcards) left out of the comparison.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

DiffOptions The same instance.
public static DiffOptions IncludeUnchanged(DiffOptions diffOptions, bool value = true) #

Sets DiffOptions.IncludeUnchanged: Whether unchanged objects are listed too (they are always counted).

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                                   // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { IncludeUnchanged = value };    diffOptions.IncludeUnchanged(value);
Key 2 overloads
public static DiffOptions Key(DiffOptions diffOptions, string item) #

Adds an item to DiffOptions.Key: The members whose values identify an object (like Compare-Object -Property for matching). Empty: Id, Name, Key...

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
item string required
The item.

Returns

DiffOptions The same instance.
public static DiffOptions Key(DiffOptions diffOptions, IEnumerable<string> items) #

Adds items to DiffOptions.Key: The members whose values identify an object (like Compare-Object -Property for matching). Empty: Id, Name, Key...

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

DiffOptions The same instance.
public static DiffOptions KeyBy(DiffOptions diffOptions, Func<object, object?>? value) #

Sets DiffOptions.KeySelector: A function that returns an object's key, instead of DiffOptions.Key.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value System.Func<object, object?>? required
The callback.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                              // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { KeySelector = value };    diffOptions.KeyBy(value);
public static DiffOptions Properties(DiffOptions diffOptions, IEnumerable<string> items) #

Adds items to DiffOptions.Properties: The members to compare, or empty for all of them.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

DiffOptions The same instance.
public static DiffOptions Property(DiffOptions diffOptions, string item) #

Adds an item to DiffOptions.Properties: The members to compare, or empty for all of them.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
item string required
The item.

Returns

DiffOptions The same instance.
public static DiffOptions Source(DiffOptions diffOptions, IMemberSource item) #

Adds an item to DiffOptions.Sources: Member sources tried before reflection (PowerShell objects, dictionaries, JSON).

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
item ConsoleMonster.Data.IMemberSource required
The item.

Returns

DiffOptions The same instance.
public static DiffOptions Sources(DiffOptions diffOptions, IEnumerable<IMemberSource> items) #

Adds items to DiffOptions.Sources: Member sources tried before reflection (PowerShell objects, dictionaries, JSON).

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Data.IMemberSource> required
The items, in order.

Returns

DiffOptions The same instance.
public static DiffOptions TimeBudget(DiffOptions diffOptions, TimeSpan value) #

Sets DiffOptions.TimeBudget: How long getters may stall in one comparison before slow members stop being read (default 2 seconds).

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value System.TimeSpan required
The value.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { TimeBudget = value };    diffOptions.TimeBudget(value);
public static DiffOptions UnwrapBy(DiffOptions diffOptions, Func<object, object>? value) #

Sets DiffOptions.Unwrap: Turns a host wrapper into the value to compare (for example a PowerShell object around a dictionary), or null.

Parameters

diffOptions ConsoleMonster.Changes.DiffOptions required
The instance.
value System.Func<object, object>? required
The callback.

Returns

DiffOptions The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Changes.DiffOptions { Unwrap = value };    diffOptions.UnwrapBy(value);