Click or drag to resize
Json.NET

MemberSerialization Enumeration

 
Specifies the member serialization options for the JsonSerializer.

Namespace:  Newtonsoft.Json
Assembly:  Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db
Syntax
C#
public enum MemberSerialization
Members
  Member nameValueDescription
OptOut0 All public members are serialized by default. Members can be excluded using JsonIgnoreAttribute or NonSerializedAttribute. This is the default member serialization mode.
OptIn1 Only members marked with JsonPropertyAttribute or DataMemberAttribute are serialized. This member serialization mode can also be set by marking the class with DataContractAttribute.
Fields2 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.
See Also