{"id":21028864,"url":"https://github.com/chamons/vinylcutter","last_synced_at":"2025-05-15T11:31:48.533Z","repository":{"id":87165469,"uuid":"142034088","full_name":"chamons/VinylCutter","owner":"chamons","description":" A C# \"Record Class\" Code Generator ","archived":false,"fork":false,"pushed_at":"2020-10-21T20:51:53.000Z","size":95,"stargazers_count":6,"open_issues_count":14,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-17T21:27:44.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chamons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-23T15:32:35.000Z","updated_at":"2021-12-08T08:47:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca547f61-5201-4af9-a37f-2a92be1f0ce6","html_url":"https://github.com/chamons/VinylCutter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamons%2FVinylCutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamons%2FVinylCutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamons%2FVinylCutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamons%2FVinylCutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chamons","download_url":"https://codeload.github.com/chamons/VinylCutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254330720,"owners_count":22053034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T11:59:25.246Z","updated_at":"2025-05-15T11:31:48.507Z","avatar_url":"https://github.com/chamons.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VinylCutter\n\n**An obsolete \"Record Class\" Code Generator for C#**\n\n\n## Overview\n\n[C# 9 now has Record Classes](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9#record-types) use that instead of this project.\n\n## Historical \n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/b/b1/Vinyl_record_LP_10inch.JPG\" alt=\"drawing\" width=\"450px\"/\u003e\n\n\nC# lacks a true \"record class\", unlike F# or Ruby, which makes simple data class declarations like:\n\n```fsharp\ntype Customer = { Name: string Name: string }\n```\n\n```ruby\nStruct.new(\"Customer\", :name, :address)\n```\n\nvery long...\n\n```csharp\npublic struct Customer\n{\n\tpublic string Name { get; private set; }\n\tpublic string Address { get; private set; }\n\t\n\tpublic Customer (string name, string address)\n\t{\n\t\tName = name;\n\t\tAddress = address;\n\t}\n}\n```\n\neven more so when you add methods to return new instances with modified items.\n\nThere is a [proposal](https://github.com/dotnet/csharplang/blob/master/proposals/records.md) to fix this. However even if accepted, it will be a long time until it is usable everywhere.\n\n**VinylCutter** is a simple code generator to generate the boilerplate for you. \n\n## Usage\n\nVinylCutter can be installed as a global .NET Core tool with the following command:\n\n`dotnet tool install --global VinylCutter`\n\nwhich can be run with:\n\n`dotnet records`.\n\nIf you recieve an error similar to `The specified framework 'Microsoft.NETCore.App', version '2.1.2' was not found` \ninstall the [latest runtime](https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial).\n\nA number of common use cases are covered in the [Quickstart](docs/quickstart.md).\n\nOne or more C# \"definition\" files are passed in to define the shape of the record class to generate. \n\nEach record is based upon the name and namespace of each class defined, with read only properties matching every property or field declared. \n\n```csharp\n[With] public class Point { int X; int Y; }\n```\n\n```csharp\npublic partial class Point\n{\n\tpublic int X { get; }\n\tpublic int Y { get; }\n\n\tpublic Point (int x, int y)\n\t{\n\t\tX = x;\n\t\tY = y;\n\t}\n\n\tpublic Point WithX (int x)\n\t{\n\t\treturn new Point (x, Y);\n\t}\n\n\tpublic Point WithY (int y)\n\t{\n\t\treturn new Point (X, y);\n\t}\n}\n```\n\nA number of [Attributes](docs/attributes.md), such as the `[With]` used above, can be added to further customize the generated code.\n\n### Generated Code Stability\n\nVinylCutter is still under active development and the generated code surface will likley evolve over time. In particular it likely will align closer to the [proposed generated code](https://github.com/chamons/VinylCutter/issues/27).\n\n### Command Line Arguments\n\n```Usage: VinylCutter.exe [OPTIONS]+ [FILES]+\nGenerate C# code from record definitions.\n\nOptions:\n      --stdin                Read record definitions from stdin, not a file.\n      --stdout               Output record generated code to stdout, not a file.\n  -o, --output=VALUE         Directory to output file to. (Defaults to current\n                               directory)\n      --extension=VALUE      Suffix to append to each file name written to\n                               output directory. (Defaults to .g.cs)\n  -h, --help                 show this message and exit\n```\n\n## Development\n\nInterested in hacking on VinylCutter?\n\nCheck out the \n[Development](docs/dev.md) document for details on how to get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamons%2Fvinylcutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchamons%2Fvinylcutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamons%2Fvinylcutter/lists"}