AnyDiff icon indicating copy to clipboard operation
AnyDiff copied to clipboard

Comparing objects of different types not working

Open sekulicb opened this issue 4 years ago • 0 comments

Hi, let's say I have an object of type Person that is base object and has two child types: Employee and Candidate. Now when comparing Employee to Candidate type I use following overload of Diff method:

var changes = source.Diff(destination, ComparionOptions.AllowCompareDifferentObjects, IgnoreProperties.ConfigureForSimpleTypes()); ( where IgnoreProperties is just a static helper class that returns an array of properties to ignore)

I can clearly see that source.FirstName and destination.FirstName are not equal, yet changes are empty every time. Both objects inherit common properties from Person. They have their own specific properties, but that was something I didn't tested. Any thought on this?

Thanks.

sekulicb avatar Oct 01 '20 18:10 sekulicb