namespace Unosquare.Swan.Attributes
{
using System;
///
/// 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, bool ignored = false)
{
PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName));
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 bool Ignored { get; }
}
}