Expand positional constructor
Property | Value |
---|---|
Id | RR0215 |
Applicable Syntax | positional record |
Syntax Span | parameter 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