Open kubaak opened 2 years ago
This is fixed now in 3.3.0 - can you confirm? https://www.nuget.org/packages/Ardalis.GuardClauses/3.3.0
Unfortunately it is not working. But I have no idea why. When I define an extension method with JetBrainsNoEnumeration that all it does is calling underlying Guard.Against.Null I don't see multiple enumeration warning.
I'm not sure why that isn't working but I don't know that it's a problem in GuardClauses library.
From JetBrains documentation/blog, these attributes are designed to not be included in the final compiled assembly - by default.
You can read a full blog about it here.
If I understood correctly, in order to fix this issue you have the following options:
I believe the decision should be made by you. But, I don't mind help fixing this issue.
Ok, I reviewed the article and it seems like the right approach for me is to include the source of the annotation/attribute in my library so there's no dependency on any third party packages, and to mark it internal. The library shows how to get the required source code but I don't have the tooling to do so. So, if someone wants to either add the source to this conversation or make a PR with it added to this repo, that would help move this issue toward completion.
Olá @tiagojsrios I am considering to try out your suggestion for fixing this issue. Are you fine with it or you prefer to try out yourself? Regards
Guard.Against.Null There is [NoEnumeration] attribute for the input used in the method. Resharper siglalizes possibility of multiple enumeration eventhough the underlying method doesn't enumerate.
1. 2.