Export (0) Print
Expand All

DataContractJsonSerializer.MaxItemsInObjectGraph Property

Gets the maximum number of items in an object graph that the serializer serializes or deserializes in one read or write call.

Namespace:  System.Runtime.Serialization.Json
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

public int MaxItemsInObjectGraph { get; }

Property Value

Type: System.Int32
The maximum number of items to serialize or deserialize.

ExceptionCondition
ArgumentOutOfRangeException

The number of items exceeds the maximum value.

This property can be set using a constructor. For a list, see DataContractJsonSerializer.

The MaxItemsInObjectGraph property specifies the maximum number of objects that the serializer serializes or deserializes in a single ReadObject or WriteObject method call. The method always reads one root object, but this object may have other objects in its data members. Those objects may have other objects. The default is MaxValue. Note that when serializing or deserializing arrays, every array entry counts as a separate object. Also, note that some objects may have a large memory representation, so this quota alone may not be sufficient to prevent Denial of Service attacks. For more information, see Security Considerations for Data. If you need to increase this quota beyond its default value, it is important to do so both on the sending (serializing) and receiving (deserializing) sides. It applies both when reading and writing data.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft