Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IsRequired Property
Collapse the table of content
Expand the table of content

DataMemberAttribute.IsRequired Property

Gets or sets a value that instructs the serialization engine that the member must be present when reading or deserializing.

Namespace: System.Runtime.Serialization
Assembly: System.Runtime.Serialization (in system.runtime.serialization.dll)

public bool IsRequired { get; set; }
/** @property */
public boolean get_IsRequired ()

/** @property */
public void set_IsRequired (boolean value)

public function get IsRequired () : boolean

public function set IsRequired (value : boolean)

Not applicable.

Property Value

true, if the member is required; otherwise, false.

Exception typeCondition

SerializationException

the member is not present.

The property is used for ensuring compatibility with future versions of a type. For more information, see Data Contract Versioning and Best Practices: Data Contract Versioning.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft