Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created June 24, 2022 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/5a691bcbcc268061c8046e8ee28d6576 to your computer and use it in GitHub Desktop.
Save lgolubyev/5a691bcbcc268061c8046e8ee28d6576 to your computer and use it in GitHub Desktop.
[JsonDerivedType(typeof(Base), typeDiscriminator: "base")]
[JsonDerivedType(typeof(Derived), typeDiscriminator: "derived")]
public class Base
{
public int X { get; set; }
}
public class Derived : Base
{
public int Y { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment