aqua - aqua-graphcompare 1.3.0

Comparer for arbitrary object graphs

PM> Install-Package aqua-graphcompare -Version 1.3.0 -Source https://www.myget.org/F/aqua/api/v3/index.json

Copy to clipboard

> nuget.exe install aqua-graphcompare -Version 1.3.0 -Source https://www.myget.org/F/aqua/api/v3/index.json

Copy to clipboard

> dotnet add package aqua-graphcompare --version 1.3.0 --source https://www.myget.org/F/aqua/api/v3/index.json

Copy to clipboard
<PackageReference Include="aqua-graphcompare" Version="1.3.0" />
Copy to clipboard
source https://www.myget.org/F/aqua/api/v3/index.json

nuget aqua-graphcompare  ~> 1.3.0
Copy to clipboard

> choco install aqua-graphcompare --version 1.3.0 --source https://www.myget.org/F/aqua/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "aqua" -SourceLocation "https://www.myget.org/F/aqua/api/v2"
Install-Module -Name "aqua-graphcompare" -RequiredVersion "1.3.0" -Repository "aqua" 
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following symbol server URL: https://www.myget.org/F/aqua/api/v2/symbolpackage/


aqua-graphcompare

branch package AppVeyor Travis CI
main NuGet Badge MyGet Pre Release Build status Travis build Status

Description

Differ for arbitrary object graphs allows to compare property values starting at a pair of root objects, recording any differences while visiting all nodes of the object graph.

The comparison result contains a list of deltas describing each difference found.

The comparer may be customized by both, subtyping and dependency injection for various purposes:

  • Override selection of properties for comparison for any given object type
  • Specify display string provider for object instance/value labeling (breadcrumb)
  • Specify display string provider for property values (old/new value display string)
  • Specify custom object mapper for advanced scenario

The comparer allows comparison of independent object types and relies on object structure and values at runtime rather than statically defined type information.

Features

  • Differ for arbitrary object graphs
  • Provides hierarchical and flat deltas
  • Allows for custom descriptions for types and members
  • Allows for custom resolution of values (i.e. display values for enums, foreign keys, etc.)

Sample

Compare two versions of a business object

var original = GetOriginalBusinessObject();
var changed = GetModifiedBusinessObject();


var result = new GraphComparer().Compare(original, changed);


Console.WriteLine("{0} {1} {2}", 
    result.FromType, 
    result.IsMatch ? "==" : "<>", 
    result.ToType);

foreach (var delta in result.Deltas)
{
    Console.WriteLine(delta.ChangeType);
    Console.WriteLine(delta.Breadcrumb);
    Console.WriteLine(delta.OldValue);
    Console.WriteLine(delta.NewValue);
}
  • .NETStandard 2.0
    • aqua-core (>= 5.3.0)
  • .NETStandard 2.0: 2.0.0.0

Owners

Christof Senn

Authors

Christof Senn

Project URL

https://github.com/6bee/aqua-graphcompare

License

MIT

Tags

compare diff graph-compare graph-diff deep-compare deep-diff object-compare object-diff

Info

6 total downloads
6 downloads for version 1.3.0
Download (29.03 KB)
Download symbols (48.94 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.3.0 29.03 KB Thu, 14 Sep 2023 02:33:26 GMT 6