Skip to main content

RCS1224: Make method an extension method

Properties

PropertyValue
Default SeverityInfo
Minimum language version-

Summary

Public/internal method in public/internal static class whose name ends with "Extensions" should be an extension method.

Examples

Example #1

diagnostic.cs
public static class FooExtensions
{
public static string Bar(Foo foo)
{
}
}
fix.cs
public static class FooExtensions
{
public static string Bar(this Foo foo)
{
}
}

Applies to