Open ADRI082 opened 5 months ago
Can you please provide an example with actual and expected result? Are you comparing objects of type List or List?
For example, I want to compare two list from Class A.
var firstList = new List(); var secondList = new List();
var comparer = new ObjectsComparer.Comparer<List>(); comparer.IgnoreMember(() => new A().example1);
This should not show me the comparisons of "example1" but it does.
How should I avoid members to compare when I am comparing two list of class A?
example1 isn't a property of your "root" object. You need to use factory. Look at this example: https://github.com/ValeraT1982/ObjectsComparer?tab=readme-ov-file#example-2-persons-comparison
Hello, I have been trying to find out how to ignore the comparison of several members but it seems that the ignoreMember method does not work properly or maybe I am doing something wrong. Could you give me a hand with this? Example :
Class A { public string example1 {get;set;} public string example2 {get;set;} public B classB {get;set;} }
Class B { public example3 {get;set;} public example4 {get;set;} }
var comparer = new ObjectsComparer.Comparer<List>(); comparer.IgnoreMember(() => new A().example1);
This example would not work. What Do I have to suppossed to do? Thanks in advance!