ObjectCompare.Linq

Shows the differences between the two objects.


Keywords
ObjectDiff, C#, Difference, .NET, CompareObjects, Compare, Diff, ObjectComparer, Comparison
License
GPL-3.0
Install
Install-Package ObjectCompare.Linq -Version 1.0.0

Documentation

ObjectCompare

Shows the differences between the two objects.

Installation

To install, run the following command in the Package Manager Console:

PM> Install-Package ObjectCompare.Linq

Dokumentation

Apart from this README, you can find details and examples of using the SDK in the following places:

Usage

var myObject = new MyObject { MyProperty = 3 };

var comparer = new ObjectComparer<MyObject>();
comparer.Config(p => {
    p.Field(f => f.MyProperty);
});

var track = comparer.Track(myObject);
myObject.MyProperty = 4;

var result = track.GetDiff();

Console.Write(string.Join("\n", result.Differences.Select(d => d.FormattedString)));

//Output: MyProperty: "3" => "4"