> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# XmlExtensionDataAttribute

> Indicates, when placed on a member of type [XmlExtensionData](/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlExtensionData), that XML attributes and ch...

## Definition

**Assembly:** CloudNimble.XmlEssentials.dll

**Namespace:** CloudNimble.Text.Xml.Serialization

**Inheritance:** System.Attribute

## Syntax

```csharp theme={"dark"}
CloudNimble.Text.Xml.Serialization.XmlExtensionDataAttribute
```

## Summary

Indicates, when placed on a member of type [XmlExtensionData](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlExtensionData.md), that XML attributes and child elements that have
no matching member are added to that member during deserialization. This class cannot be inherited.

## Usage

Put `[XmlExtensionData]` on a member of type `XmlExtensionData` to keep the attributes and elements that no other member of the type maps. Without such a member, the serializer skips that content, or rejects it when `XmlSerializerOptions.UnmappedMemberHandling` is `Disallow`. The attribute corresponds to `[JsonExtensionData]` in System.Text.Json.

```csharp theme={"dark"}
public sealed class Settings
{
    public string? Theme { get; set; }

    [XmlExtensionData]
    public XmlExtensionData? Extra { get; set; }
}
```

After deserializing, `Extra.Attributes` and `Extra.Elements` hold what the document had beyond `Theme`. When you serialize the object, that content is written back. See `XmlExtensionData` for an example with its output, and [Mixed content and overflow](https://easyaf.nimbleapps.cloud/xmlessentials/guides/mixed-content.md#keep-content-that-no-member-maps) for the walkthrough.

## Remarks

The member must be of type [XmlExtensionData](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlExtensionData.md), and a type can have only one member with this attribute.
The reflection-based serializer throws a [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) when either rule is broken.

## Considerations

* The member must be of type `XmlExtensionData`. On a member of any other type, the serializer throws `NotSupportedException` when it builds the type's metadata. A dictionary is not accepted.
* A type can have one extension data member. A second one also throws `NotSupportedException`.
* The member isn't written as an element of its own. Its content is written directly into the containing element.
* If the document has no unmapped content, the member isn't assigned. If the member already holds an object when content is captured, the content is added to that object, so a get-only member that the type initializes works too.
* A type with an extension data member accepts unmapped content even when `UnmappedMemberHandling` is `Disallow`.
* Don't combine it with `[XmlMixed]` on the same type. In a mixed-content type every child element goes to the mixed list, so no element reaches the extension data.

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public XmlExtensionDataAttribute()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
protected Attribute()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;TypeId Inherited Virtual

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public virtual object TypeId { get; }
```

#### Property Value

Type: `object`

## Methods

### &#x20;Equals Override

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public override bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.Module element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.Module element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttribute Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute?`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetCustomAttributes Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `System.Attribute[]`

### &#x20;GetHashCode Override

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public override int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;IsDefaultAttribute Inherited Virtual

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public virtual bool IsDefaultAttribute()
```

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.MemberInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.ParameterInfo` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Module` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |

#### Returns

Type: `bool`

### &#x20;IsDefined Inherited

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType, bool inherit)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `element` | `System.Reflection.Assembly` | - |
| `attributeType` | `System.Type` | - |
| `inherit` | `bool` | - |

#### Returns

Type: `bool`

### &#x20;Match Inherited Virtual

> [!NOTE]
>
> Inherited from `System.Attribute`

#### Syntax

```csharp theme={"dark"}
public virtual bool Match(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

## Related APIs

* CloudNimble.Text.Xml.Serialization.XmlExtensionData
* CloudNimble.Text.Xml.Serialization.XmlUnmappedMemberHandling
* CloudNimble.Text.Xml.Serialization.XmlMixedAttribute
* CloudNimble.Text.Xml.XmlSerializerOptions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.