Definition
Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: System.AttributeSyntax
Summary
Prevents a property or field from being serialized or deserialized, or from being written when a condition is met. This class cannot be inherited.Usage
Apply[XmlIgnore] to a property or field to keep it out of the XML. It is the counterpart of [JsonIgnore]. With no arguments, the member is never written and never read.
Condition to leave the member out only when it has no value:
Considerations
- With the default condition,
Always, the member isn’t part of the type’s XML mapping at all. An element for it in incoming XML is an unmapped member: skipped by default, and an error whenUnmappedMemberHandlingisDisallow. - With
WhenWritingNull,WhenWritingDefault, orWhenWriting, the member is still read when the XML has it. Those conditions affect writing only.WhenReadingis the other way round: the member is written and never read. - The attribute overrides
XmlSerializerOptions.DefaultIgnoreConditionfor the member.[XmlIgnore(Condition = XmlIgnoreCondition.Never)]keeps a member in every document when the option would leave it out. - Ignoring a positional record property with
[property: XmlIgnore]leaves its constructor parameter with no member to bind to, and the record can no longer be deserialized. - To leave out every
nullmember at once, setDefaultIgnoreConditionon the options.
Constructors
.ctor
Syntax
.ctor Inherited
Inherited from
System.AttributeSyntax
.ctor Inherited
Inherited from
objectSyntax
Properties
Condition
Gets or sets the condition that must be met before the member is ignored.Syntax
Property Value
Type:CloudNimble.Text.Xml.Serialization.XmlIgnoreCondition
One of the enumeration values that specifies when the member is ignored. The default is XmlIgnoreCondition.Always.
Remarks
The value takes precedence over XmlSerializerOptions.DefaultIgnoreCondition for the member.TypeId Inherited Virtual
Inherited from
System.AttributeSyntax
Property Value
Type:object
Methods
Equals Override
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetHashCode Override
Inherited from
System.AttributeSyntax
Returns
Type:int
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
IsDefaultAttribute Inherited Virtual
Inherited from
System.AttributeSyntax
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Match Inherited Virtual
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Related APIs
- CloudNimble.Text.Xml.Serialization.XmlIgnoreCondition
- CloudNimble.Text.Xml.Serialization.XmlIncludeAttribute
- CloudNimble.Text.Xml.Serialization.XmlUnmappedMemberHandling
- CloudNimble.Text.Xml.XmlSerializerOptions