Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 729 Bytes

File metadata and controls

40 lines (27 loc) · 729 Bytes
layout page
title CC0011
tagline RemoveWhereWhenItIsPossibleAnalyzer

|TypeName|RemoveWhereWhenItIsPossibleAnalyzer | |Check Id | CC0011 | |Category | Performance | |Severity | Warning |

Cause

When a linq operator support a predicate parameter it should be used instead of using 'Where' followed by the operator

Example

{% highlight csharp %} var a = new int[10]; var f = a.Where(item => item > 10).First(); {% endhighlight %}

Code fix

A code fix will be presented to you that will transform the code:

{% highlight csharp %} var a = new int[10]; var f = a.First(item => item > 10); {% endhighlight %}

![Code fix]({{ BASE_PATH }}/assets/images/CC0011/codefix0.png)

Related rules

None

See also

TBD