Zaybu.ZCompare 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Zaybu.ZCompare --version 1.3.0
NuGet\Install-Package Zaybu.ZCompare -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zaybu.ZCompare" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Zaybu.ZCompare --version 1.3.0
#r "nuget: Zaybu.ZCompare, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Zaybu.ZCompare as a Cake Addin
#addin nuget:?package=Zaybu.ZCompare&version=1.3.0

// Install Zaybu.ZCompare as a Cake Tool
#tool nuget:?package=Zaybu.ZCompare&version=1.3.0
  1. Null values passed into Compare() method now behave consistently with null values encountered in an object hierarchy. This may have an impact on existing code if you are passing in a null value and a reference value to compare, and testing for the 'ResultStatus.Changed' value. The result will now be 'ResultStatus.Added' or 'ResultStatus.Deleted' if one of the arguments is null (only for reference values! For value types as the non null argument then the behaviour is unchanged)

When passing null values as parameters into the ZCompare.Compare<T>(T objectA, T objectB) method, the results are now consistent with any other null values in the object graph of non null types.

i.e. For reference types, var results = ZCompare.Compare(myObject, null) now results in results.Root.Status = ResultStatus.Deleted. Prior to this release the Status was ResultStatus.Changed. For value types the behaviour is the same as the previous release, the Status = ResultStatus.Changed

Also, ZCompare.Compare(null, myObject) now results in results.Root.Status = ResultStatus.Added.

  1. ZCompareOptions enum introduced. usage: ZCompare.Options = ZCompareOptions.FullComparisonResultsForNulls

When this option is set your results will contain full object graph comparison results for null values. Without it set you just get one result for the null value - either Added or Deleted. Now, with this option set you will get results for all child nodes and properties of the object being compared with the null value.

e.g var results = ZCompare.Compare(myObject, null)

The results will contain individual results for each property of myObject, in this case they will all be 'Deleted' results. Without this option set you just get 1 result on the myObject.

This allows nulls to be processed consistently with non-null object parameters. e.g var myResults = results.GetResult<ChildType>(myObject.ChildProperty); now works consistently if the initial call to ZCompare.Compare(myObject, null) contains a null value or not.

  1. Bug fixes:

Passing two null values into ZCompare.Compare<T>(T objectA, T objectB) method now returns results.Identical = true.

Custom comparators now get called if any of the parameters in ZCompare.Compare<T>(T objectA, T objectB) method are null.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.3 6,999 4/6/2021
1.3.1 2,130 3/7/2019
1.3.0 981 10/4/2018
1.2.7 5,907 6/25/2017