Created
June 6, 2021 14:49
-
-
Save rstropek/076b6d63d6fd49eff33d1cd2f377006e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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