Class JsonArrayAttribute
- Namespace
- Newtonsoft.Json
- Assembly
- Newtonsoft.Json.dll
Instructs the JsonSerializer how to serialize the collection.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false)]
public sealed class JsonArrayAttribute : JsonContainerAttribute
- Inheritance
-
JsonArrayAttribute
- Inherited Members
Constructors
JsonArrayAttribute()
Initializes a new instance of the JsonArrayAttribute class.
public JsonArrayAttribute()
JsonArrayAttribute(bool)
Initializes a new instance of the JsonObjectAttribute class with a flag indicating whether the array can contain null items
public JsonArrayAttribute(bool allowNullItems)
Parameters
allowNullItems
boolA flag indicating whether the array can contain null items.
JsonArrayAttribute(string)
Initializes a new instance of the JsonArrayAttribute class with the specified container Id.
public JsonArrayAttribute(string id)
Parameters
id
stringThe container Id.
Properties
AllowNullItems
Gets or sets a value indicating whether null items are allowed in the collection.
public bool AllowNullItems { get; set; }
Property Value
- bool
true
if null items are allowed in the collection; otherwise,false
.