Cheers,
Running a static code analysis on a C# solution, I find the warning CA1006 "Do not nest generic types in member signatures" in various parts of the code where a generic type is used to pass it as an argument to a Func that is inside. from an Expression:
IEnumerable<T> GetForMe(Expression<Func<T, bool>> filter, IEnumerable<T> entity);
The signature above is part of a generic interface where T is the generic type.
The warning message is clear to me and looking at the documentation it makes a lot of sense that the warning appears and more so if its category is "Design".
However, I can't find a "fancy" way to "change the layout" of these signatures. Most of the places where this warning is cited say that it is better to omit it with the attribute [SuppressMessage]
.
In the microsoft documentation at: https://msdn.microsoft.com/library/ms182144.aspx it says:
Do not suppress the warnings in this rule. Providing generics with a syntax that is easy to understand and use reduces the time required to learn and increases the speed of adoption of new libraries.
Regardless of whether I suppress it or not, I would really like to know what would be the best way to adjust the layout of the signature.
Thanks.