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

Unused setter

CodeRush Classic shows the Unused setter code issue if a fully-implemented property has a private setter.

Fix

Remove the private setter.

Purpose

Highlights the never referenced set accessors, which can be removed to improve code readability.

Example

private string _Name;
public string Name
{
    get { return _Name; }private set { _Name = value; }
}

Fix:

private string _Name;
public string Name
{
    get { return _Name; }
}