Skip to content

A code refactoring for Visual Studio to enable converting a record to a class

Notifications You must be signed in to change notification settings

jeppevammenkristensen/For-the-record

Repository files navigation

For-the-record

A code refactoring for Visual Studio to enable converting a record to a class

This is a tool lazy people like my self. It allows you to convert a record like this

public record SomeRecord (int Id, string Name, int Number) { }

And the code refactoring will suggest either to Convert to class

public class SomeRecord
{
    public int Id {get;set;}
    
    public string Name {get;set;}
    
    public int Number {get;set;}
    
}

Or Convert to class (init properties from constructor)

public class SomeRecord
{
    public int Id {get;set;}
    
    public string Name {get;set;}
    
    public int Number {get;set;}
    
    public SomeRecord(int id, string name, int number)
    {
      this.Id = id;
      this.Name = name;
      this.Number = number
    }

}

About

A code refactoring for Visual Studio to enable converting a record to a class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages