Tutorials

Quick Start Tutorial

Get coding and comparing objects quickly. Introduces the syntax and how to work with the results effectively

Features Tutorial

Explore the cusomization and extensibility features. Compare objects they way you want them comparing.

Complex data with a Micro ORM

Perform complex update, delete and create actions easily.

Highlights

Syntax

var results = ZCompare.Compare(originalObject, modifiedObject);
                

Typesafe Results

List<Supplier> originalSuppliers;
List<Supplier> updatedSuppliers;
// Initialisation and changes to list of objects here...
var results = ZCompare.Compare(originalSuppliers, updatedSuppliers);
var supplierResults = results.GetResults<Supplier>(originalSuppliers);
supplierResults.ForEach(s =>
{
    var productResults = results.GetResults<Product>(s.OriginalValue.Products);
}
                

Ignore Properties, Types & Namepsaces

ZCompare.IgnoreProperty(typeof(Supplier), "Created", typeof(DateTime));
ZCompare.IgnoreNamespace("System.Runtime");
ZCompare.IgnoreType(typeof(byte[]));
[IgnoreProperty]
public byte[] ImageData { get; set; }
                

Custom Comparitors

ZCompare.RegisterComparitor(new SupplierCustomComparitor());

public class SupplierCustomComparitor : ComparitorBase<Supplier>
{
    public override void Compare(Supplier originalObject, Supplier compareToObject, Results results)
    {
        /* In here we have complete control over what and how things are compared */
        if (originalObject.ID != compareToObject.ID)
        {
            results.AddResult("Supplier ID's are different", ResultStatus.Changed, originalObject.ID, compareToObject.ID);
        }
    }
}