GitPedia

RecordGenerator

C# immutable records generator

From amis92·Updated April 17, 2026·View on GitHub·

Documentation available at [amis92.github.io/RecordGenerator](https://amis92.github.io/RecordGenerator) (or in [docs folder](docs/README.md)). The project is written primarily in C#, distributed under the MIT License license, first published in 2017. Key topics include: amadevus, code-generation, code-generator, csharp, csharp-library.

Latest release: v0.6.0Update to CodeGeneration.Roslyn v0.7
April 8, 2020View Changelog →

Amadevus.RecordGenerator

RecordGenerator logo

ℹ This is for v0.6 of RecordGenerator.

Documentation available at amis92.github.io/RecordGenerator (or in docs folder).

Description

C# Record Generator makes creating immutable record types a breeze! Just adorn your data class with [Record] attribute
and keep your code clean and simple. The backing code is generated on build-time, including IntelliSense support
(just save the file, Visual Studio will make a build in background).

Join the chat at gitter!
License

NuGet package
NuGet package preview
MyGet package

GitHub Actions - .NET CI workflow
Azure Pipelines Build Status


Demo

Installation, usage, examples and all other docs available at amis92.github.io/RecordGenerator

csharp
using System; using Amadevus.RecordGenerator; namespace QuickDemo { [Record(Features.Default | Features.Equality)] public sealed partial class Contact { public int Id { get; } public string Name { get; } public string Email { get; } public DateTime? Birthday { get; } } public static class Program { public static void Main() { var adam = new Contact.Builder { Id = 1, Name = "Adam Demo", Email = "foo@bar.com" }.ToImmutable(); var adamWithBday = adam.WithBirthday(DateTime.UtcNow); Console.WriteLine("Pretty display: " + adamWithBday); // Pretty display: { Id = 1, Name = Adam Demo, Email = foo@bar.com, Birthday = 06.01.2020 23:17:06 } Console.WriteLine("Check equality: " + adam.Equals(adamWithBday)); // Check equality: False Console.WriteLine("Check equality: " + adam.Equals(new Contact(1, "Adam Demo", "foo@bar.com", null))); // Check equality: True } } }

The above is taken from QuickDemo sample

Development

To build the solution, .NET Core SDK v3.1.100 is required, as specified in global.json.

Credits

Amadevus.RecordGenerator wouldn't work if not for @AArnott AArnott's CodeGeneration.Roslyn.

Analyzers in Amadevus.RecordGenerator.Analyzers were inspired by xUnit.net's analyzers.

Contributions

All contributions are welcome, as well as critique. If you have any issues, problems or suggestions -
please open an issue.

Visual Studio logo ™ Microsoft Corporation, used without permission.

RecordGenerator logo (on top) © 2017 Amadeusz Sadowski, all rights reserved.

Contributors

Showing top 6 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from amis92/RecordGenerator via the GitHub API.Last fetched: 6/23/2026