2.4.0
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!