The requested page is not available for the requested platform. You are viewing the content for Default platform.

Partial method has only single part

CodeRush Classic shows the Partial method has only single part code issue if a partial method consists of only a single part.

Fix

Declare another part of the partial method.

Purpose

Partial method has only single part directs your attention to partial methods, which consist of only a single part because they denote an incomplete code.

Example

public partial class MyClass
{
    partial void ProcessString(string text);
}

Fix:

public partial class MyClass
{
    partial void ProcessString(string text);
    partial void ProcessString(string text)
    {
        Console.WriteLine(text);
    }
}