Fork me on GitHub
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

var a = new int[10];
var f = a.Where(item => item > 10).First();

Code fix

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

var a = new int[10];
var f = a.First(item => item > 10);

Code fix

Related rules

None

See also

TBD