DeepEqual
DeepEqual copied to clipboard
Comparison of KeyValuePair types
Found an issue - IsDeepEqueal() method returns false as the comparison result of exact KeyValuePair objects. That's working well when I'm using KeyValuePair with primitive types, but not working with my other defined types.
public class Model
{
public int Id { get; set; }
public string Name { get; set; }
}
class Program
{
static void Main(string[] args)
{
var model_1 = new KeyValuePair<string, Model>("1", new Model() { Id = 10, Name = "1" });
var model_2 = new KeyValuePair<string, Model>("1", new Model() { Id = 10, Name = "1" });
var model_3 = new KeyValuePair<int, string>(1, "1");
var model_4 = new KeyValuePair<int, string>(1, "1");
Console.WriteLine(model_1.IsDeepEqual(model_2));
Console.WriteLine(model_3.IsDeepEqual(model_4));
}
}
@jamesfoster I'd like to take a look at it - are you ok with that?
Will be released in version 4.0.0