Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


RecordGenerator logo

This is for v0.6 of RecordGenerator.

Documentation available at (or in docs folder).


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


Installation, usage, examples and all other docs available at

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 = ""
            var adamWithBday = adam.WithBirthday(DateTime.UtcNow);
            Console.WriteLine("Pretty display: " + adamWithBday);
            // Pretty display: { Id = 1, Name = Adam Demo, Email =, 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", "", null)));
            // Check equality: True

The above is taken from QuickDemo sample


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


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

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


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.

You can’t perform that action at this time.