Generator.Equals icon indicating copy to clipboard operation
Generator.Equals copied to clipboard

feat: Added EquatableAttribute.IgnoreBaseClassProperties parameter.

Open HavenDV opened this issue 3 years ago • 4 comments

Another option from https://github.com/Fody/Equals#configurability Needed in some cases in Explicit mode to ignore comparison of base classes.

HavenDV avatar Sep 12 '22 14:09 HavenDV

Happy to have this included, but could you add test cases for this feature?

diegofrata avatar Sep 14 '22 18:09 diegofrata

Just to clarify, would you accept a PR that formats the generated code so it's readable? Example: image

HavenDV avatar Sep 15 '22 05:09 HavenDV

Yeah, I would definitely accept a PR for that if it doesn't make the code-generation any more unreadable than it already is.

diegofrata avatar Sep 15 '22 15:09 diegofrata

Yeah, I would definitely accept a PR for that if it doesn't make the code-generation any more unreadable than it already is.

I gave an example in my post, does this formatting suit you?

HavenDV avatar Sep 16 '22 06:09 HavenDV

I am happy with the formatting in your example. Happy for you to submit it in a different PR!

One small thing so that I can merge this PR: can you change IgnoreBaseClassProperties to IgnoreInheritedMembers? Not sure if you had seen my earlier comment on it, but we support both records and classes, and might also support fields in addition to properties in the future.

diegofrata avatar Sep 16 '22 10:09 diegofrata

I also see a small problem with tests and in general with the operation of the generator in VS due to Debugger.Launch. I will also provide a PR for this image

HavenDV avatar Sep 17 '22 05:09 HavenDV