Skip to content
GregFinzer edited this page Nov 21, 2017 · 10 revisions

Q: One thing im not sure how to accomplish is to actually get which items have been added or removed when comparing? It shows the count is different but i dont see how to actually get the needed items. any clue?

A: Set Config.IgnoreCollectionOrder to false

Q: I would like to report a defect. I have an object with many differences and it is only reporting one difference.

A: By default for performance reasons, Compare .NET Objects only detects the first difference. To capture all differences set Config.MaxDifferences to the maximum differences desired.

Q: I want to show all the differences in my list of objects. If the lists are different counts, it doesn't compare everything. How can I compare it?

A: Set Config.MaxDifferences to the maximum difference desired. Set Config.IgnoreCollectionOrder to true. If you have a primary key for the class, make sure to define a Config.CollectionMatchingSpec.

Q: What if I don't want to compare everything?

A: Add the names of class types to the Config.ClassTypesToIgnore or add the names of members to the Config.MembersToIgnore. If you need something more complex, you can always implement your own custom comparer. See Custom Comparers.

Q: Do we have any config exposed to ignore string cases while comparison ?

A: No, but what you can do is add your own string comparer to the custom comparers and ignore the case.

Q: I would like to know if it is possible to provide a wildcard for membernames to ignore, or if that is possible to provide a member ignore callback?

A: Sorry no, it does not support something like that.