Skip to content

Instantly share code, notes, and snippets.

@rstropek
Created June 6, 2021 14:49
Show Gist options
  • Save rstropek/076b6d63d6fd49eff33d1cd2f377006e to your computer and use it in GitHub Desktop.
Save rstropek/076b6d63d6fd49eff33d1cd2f377006e to your computer and use it in GitHub Desktop.
using System;
var o = new TypeA("FooBar", 42);
Console.WriteLine(o);
public abstract record BaseRecord(string Name)
{
public sealed override string ToString() => Name;
}
public sealed record TypeA(string Name, int Parameter) : BaseRecord(Name);
public sealed record TypeB(string Name, double Parameter) : BaseRecord(Name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment