Fork me on GitHub
TypeName CallExtensionMethodAsExtensionAnalyzer
Check Id CC0026
Category Usage
Severity Info

Cause

You can simplify a call to some static methods by using their Extension method implementation.

Example

public void Bar()
{
	var source = new int[] { 1, 2, 3 };
	Enumerable.Any(source, x => x > 1);
}

Code fix

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

public void Bar()
{
	var source = new int[] { 1, 2, 3 };
	source.Any(x => x > 1);
}

Code fix

Related rules

None

See also

TBD