Zaybu.ZCompare 1.3.0

ZCompare .Net object comparison

Full autonomous typesafe .Net object comparison with high resolution control through extensibility and customisation. Compare any objects you want, how you want and easily get the results you need.

Install-Package Zaybu.ZCompare -Version 1.3.0
dotnet add package Zaybu.ZCompare --version 1.3.0
paket add Zaybu.ZCompare --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
  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.

  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.

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.3.0 74 10/4/2018
1.2.7 593 6/25/2017