PropertyChange
ConsoleMonster.Changes
One changed property of an object (a nested path such as Address.City for nested objects).
Inheritance
- object
- PropertyChange
Usage
Explore 4 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.
Returned or exposed by 3
- Property ObjectChange.Properties
- Property ObjectChange.Values
- Method ObjectDiff.CompareObjects
Accepted by parameters 1
- Constructor ObjectChange.ObjectChange
Constructors
public PropertyChange(string path, object? before, object? after) #Creates a property change.
Parameters
- path string
- The property path.
- before object?
- The old value.
- after object?
- The new value.
public PropertyChange(string path, object? before, object? after, bool hasBefore = true, bool hasAfter = true, bool isCaseOnly = false) #Creates a property comparison with explicit presence and case-only information.
Parameters
- path string
- The property path.
- before object?
- The original old value.
- after object?
- The original new value.
- hasBefore bool = true
- Whether the old property exists, even when its value is null.
- hasAfter bool = true
- Whether the new property exists.
- isCaseOnly bool = false
- Whether case-insensitive comparison found only a case difference.
Methods
public override string ToString() #Returns a string that represents the current object.
Returns
string A string that represents the current object.Inherited Methods
Properties
public bool HasBefore { get; } #Whether the old property exists; null is a present value.
public bool HasAfter { get; } #Whether the new property exists; null is a present value.
public bool IsCaseOnly { get; } #A visible case-only difference ignored for changed counts.
public string BeforeText { get; } #The old value as display text; dates that differ only below a minute show their seconds.
public string AfterText { get; } #The new value as display text; dates that differ only below a minute show their seconds.