Get coding and comparing objects quickly. Introduces the syntax and how to work with the results effectively
Explore the cusomization and extensibility features. Compare objects they way you want them comparing.
Perform complex update, delete and create actions easily.
var results = ZCompare.Compare(originalObject, modifiedObject);
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);
}
ZCompare.IgnoreProperty(typeof(Supplier), "Created", typeof(DateTime));
ZCompare.IgnoreNamespace("System.Runtime");
ZCompare.IgnoreType(typeof(byte[]));
[IgnoreProperty]
public byte[] ImageData { get; set; }
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);
}
}
}