using System; namespace LC.Newtonsoft.Json { /// /// Instructs the to deserialize properties with no matching class member into the specified collection /// and write values during serialization. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] public class JsonExtensionDataAttribute : Attribute { /// /// Gets or sets a value that indicates whether to write extension data when serializing the object. /// /// /// true to write extension data when serializing the object; otherwise, false. The default is true. /// public bool WriteData { get; set; } /// /// Gets or sets a value that indicates whether to read extension data when deserializing the object. /// /// /// true to read extension data when deserializing the object; otherwise, false. The default is true. /// public bool ReadData { get; set; } /// /// Initializes a new instance of the class. /// public JsonExtensionDataAttribute() { WriteData = true; ReadData = true; } } }