Skip to content

2.4.0

Compare
Choose a tag to compare
@diegofrata diegofrata released this 25 Aug 18:26
· 52 commits to main since this release
e58545f

The generator now allows you to explicitly specify which properties are used to generate the IEquatable.

To do this, set the Explicit property of EquatableAttribute to true and specify the required properties using DefaultEqualityAttribute or other attributes.

using Generator.Equals;

[Equatable(Explicit = true)]
partial class MyClass
{
    // Only this property will be used for equality!
    [DefaultEquality] 
    public string Name { get; set; } = "Konstantin"; 
    
    public string Description { get; set; } = "";
}

Thanks to @HavenDV for this contribution!