ObjectsComparer
ObjectsComparer copied to clipboard
Compare always returns true (is equal)?
I might have missed something important, but this does not seem to work at all for me?
The Compare method seems to return true (is equal) all the time, regardless if they objects are different or not. Here are two screenshots that shows this:
In the image above, we can see that
firstObject.IsReturnBooking
is true
, and secondCopy.IsReturnBooking
is false
.
If I then step one more line, and look at the isEqual
and differences
, they show that the objects are equal, no changes detected:
I am running .NET 7 in Visual Studio 2022, version of lib used is 1.4.1
Can you please provide the definition of Booking?
To troubleshoot you can:
- Create 2 bookings and try to compare them (no deserialization).
- If the previous step works, create 2 JSON files with different bookings, deserialize and try to compare (no random property changes)
Try to create a minimal example that returns true when objects are different and include all code of that example.