ignore collection count#256
ignore collection count#256GregFinzer merged 7 commits intoGregFinzer:masterfrom sebasijan:ignore-collection-count
Conversation
|
Thanks for the pull request submission. This implementation is going to confuse people later. If the counts are different and one list is longer than the other then the longer list items will not be compared. Please make a IReadOnlyCollectionComparer and ignore the count when CompareReadOnly == false |
|
I am thinking that maybe the IReadOnlyCollection would not be compared at all if CompareReadOnly == false |
…n/Compare-Net-Objects into ignore-collection-count # Conflicts: # Compare-NET-Objects-Tests/IgnoreTests.cs
|
I just realised that your last comment suggests ignoring the entire collection, but I am hoping to have the functionality of just ignoring the |
|
Now this is just a defect that is specific to a read only collection. What I would do is simply this:
var differencesWithoutCount = Differences.Where(o => o.ChildPropertyName != "Count" && !o.Object1TypeName.Contains("ReadOnlyCollection")); |
|
Ye that is my current approach, but I'm not a huge fan because I then need to specify the same for every type of collection I might be using in my classes I just thought that it made sense to exclude I can always just add the filter for any collection type I happen to be using |
|
Updated the PR to simply ignore ReadOnlyCollections when |
No description provided.