Newtonsoft.Json by James Newton-King

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

 MemberSerialization

public enum MemberSerialization
Specifies the member serialization options for the JsonSerializer.
Fields = 2

All public and private fields are serialized. Members can be excluded using JsonIgnoreAttribute or NonSerializedAttribute. This member serialization mode can also be set by marking the class with SerializableAttribute and setting IgnoreSerializableAttribute on DefaultContractResolver to false.

OptIn = 1

Only members must be marked with JsonPropertyAttribute or DataMemberAttribute are serialized. This member serialization mode can also be set by marking the class with DataContractAttribute.

OptOut = 0

All public members are serialized by default. Members can be excluded using JsonIgnoreAttribute or NonSerializedAttribute. This is the default member serialization mode.