Newtonsoft.Json by James Newton-King

<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />

 TypeNameHandling

public enum TypeNameHandling
Specifies type name handling options for the JsonSerializer.
All = 3

Always include the .NET type name when serializing.

Arrays = 2

Include the .NET type name when serializing into a JSON array structure.

Auto = 4

Include the .NET type name when the type of the object being serialized is not the same as its declared type. Note that this doesn't include the root serialized object by default. To include the root object's type name in JSON you must specify a root type object with SerializeObject or Serialize.

None = 0

Do not include the .NET type name when serializing types.

Objects = 1

Include the .NET type name when serializing into a JSON object structure.