# OpcDataTypeEncodingAttribute Class

> Reference: Defines the information about the encoding used for a custom data type which is represented by the Type on that this attribute is applied.

<span class="api-meta">since v2.8</span>

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcDataTypeEncodingAttribute Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Defines the information about the encoding used for a custom data type which is represented by the [Type](https://learn.microsoft.com/dotnet/api/system.type) on that this attribute is applied.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public class OpcDataTypeEncodingAttribute : Attribute
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Enum, AllowMultiple:=True, Inherited:=False)>
Public Class OpcDataTypeEncodingAttribute
    Inherits Attribute
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) → **OpcDataTypeEncodingAttribute**

## Constructors

| Name | Description |
|---|---|
| [OpcDataTypeEncodingAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#opcdatatypeencodingattribute)<span class="api-meta">12 overloads</span> | Initializes a new instance of the OpcDataTypeEncodingAttribute class using the `id` to use to identify the according data type encoding node. |

## Properties

| Name | Description |
|---|---|
| [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#id) | Gets the node identifier used to define the data type encoding node of the [Type](https://learn.microsoft.com/dotnet/api/system.type) to that the attribute has been applied. |
| [NamespaceUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#namespaceuri) | Gets or sets the URI (Uniform Resource Identifier) or string literal used to identify the namespace the encoding of the [Type](https://learn.microsoft.com/dotnet/api/system.type), to that the attribute has been applied, belongs to. |
| [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#type) | Gets or sets the type of encoding the node, referred to by the [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#id) property of this attribute, represents. |

## Methods

| Name | Description |
|---|---|
| [GetEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeencodingattribute/members#getencoding) | Retrieves the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) declared by the OpcDataTypeEncodingAttribute. |

Inherits members from [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute).

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.8–v2.59 |
