Skip to main content

Expand positional constructor

PropertyValue
IdRR0215
Applicable Syntaxpositional record
Syntax Spanparameter list
Enabled by Default

Usage

Example #1

before.cs
public record Foo([property: Obsolete] string Value1, string Value2);
after.cs
public record Foo
{
public Foo(string value1, string value2)
{
Value1 = value1;
Value2 = value2;
}

[Obsolete]
public string Value1 { get; init; }
public string Value2 { get; init; }
}

Configuration

roslynator_refactoring.expand_positional_constructor.enabled = true|false