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

Partial class has only single part

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

Fix

Remove the redundant partial modifier from the class declaration.

Purpose

Highlights the partial class declarations, which can be made non-partial to improve code readability.

Example

public partial class MyClass
{
    public MyClass(string name)
    {
        Name = name;
    }
    public string Name { get; private set; }
}

Fix:

public class MyClass
{
    public MyClass(string name)
    {
        Name = name;
    }
    public string Name { get; private set; }
}