A shortcut to convert classes into records in c#

Viewed 1222

If I have the following class:

public class Foo
{
    public string Code { get; set; }
    public string Description { get; set; }
    public DateTime? EffectiveDate { get; set; }
}

and I want to quickly convert it to a record type:

public record Foo(string Code, string Description, DateTime? EffectiveDate);

Is there a way to do that quickly? the built-in quick actions menu in VS19 doesn't seem to offer this.

2 Answers

dotnet developers are working on that according to this issue classtorecode

Related