Class JsonContainerAttribute
Instructs the JsonSerializer how to serialize the object.
Inheritance
Implements
Inherited Members
Namespace: Bayat.Json
Assembly: Bayat.Json.Runtime.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
public abstract class JsonContainerAttribute : Attribute, _Attribute
Constructors
| Improve this Doc View SourceJsonContainerAttribute()
Initializes a new instance of the JsonContainerAttribute class.
Declaration
protected JsonContainerAttribute()
JsonContainerAttribute(String)
Initializes a new instance of the JsonContainerAttribute class with the specified container Id.
Declaration
protected JsonContainerAttribute(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The container Id. |
Fields
| Improve this Doc View Source_isReference
Declaration
protected bool? _isReference
Field Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
_itemIsReference
Declaration
protected bool? _itemIsReference
Field Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
_itemReferenceLoopHandling
Declaration
protected ReferenceLoopHandling? _itemReferenceLoopHandling
Field Value
Type | Description |
---|---|
System.Nullable<ReferenceLoopHandling> |
_itemTypeNameHandling
Declaration
protected TypeNameHandling? _itemTypeNameHandling
Field Value
Type | Description |
---|---|
System.Nullable<TypeNameHandling> |
Properties
| Improve this Doc View SourceDescription
Gets or sets the description.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
Id
Gets or sets the id.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String | The id. |
IsReference
Gets or sets a value that indicates whether to preserve object references.
Declaration
public bool IsReference { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ItemConverterParameters
The parameter list to use when constructing the JsonConverter described by ItemConverterType. If null, the default constructor is used. When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number, order, and type of these parameters.
Declaration
public object[] ItemConverterParameters { get; set; }
Property Value
Type | Description |
---|---|
System.Object[] |
Examples
[JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
| Improve this Doc View SourceItemConverterType
Gets the collection's items converter.
Declaration
public Type ItemConverterType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The collection's items converter. |
ItemIsReference
Gets or sets a value that indicates whether to preserve collection's items references.
Declaration
public bool ItemIsReference { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ItemReferenceLoopHandling
Gets or sets the reference loop handling used when serializing the collection's items.
Declaration
public ReferenceLoopHandling ItemReferenceLoopHandling { get; set; }
Property Value
Type | Description |
---|---|
ReferenceLoopHandling | The reference loop handling. |
ItemTypeNameHandling
Gets or sets the type name handling used when serializing the collection's items.
Declaration
public TypeNameHandling ItemTypeNameHandling { get; set; }
Property Value
Type | Description |
---|---|
TypeNameHandling | The type name handling. |
Title
Gets or sets the title.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title. |