using System; namespace Unosquare.Swan.Attributes { /// /// An attribute used to help setup a property behavior when serialize/deserialize JSON. /// /// [AttributeUsage(AttributeTargets.Property)] public sealed class JsonPropertyAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// Name of the property. /// if set to true [ignored]. public JsonPropertyAttribute(String propertyName, Boolean ignored = false) { this.PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName)); this.Ignored = ignored; } /// /// Gets or sets the name of the property. /// /// /// The name of the property. /// public String PropertyName { get; } /// /// Gets or sets a value indicating whether this is ignored. /// /// /// true if ignored; otherwise, false. /// public Boolean Ignored { get; } } }