Is it possible to remove the suggestion to 'Replace with single call to .Single(..)'?
The R# suggestion shows when, for example, typing the following:
new[] { 1,2,3,4,5 }
.Where(a => a == 1)
.Single();
It reads:
Replace with single call to Single(..);
which changes to code to:
new[] { 1,2,3,4,5 }
.Single(a => a == 1);
which I prefer less as I believe it is less clear in longer LINQ queries. It also, I am told, performs worse that using .Where() to filter the data. Can I globally disable just this suggestion and the similar suggestions for SingleOrDefault, First, FirstOrDefault, Last, and LastOrDefault, but leave the other R# suggestions?
Please sign in to leave a comment.
Hello!
Thank you for contacting us.
You can disable or configure corresponding inspection severity in ReSharper | Options | Code Inspection | Inspection Severity.
Thank you.