# OpcDataTypeAttribute Class

> Reference: Defines the identifier of a custom data type which is represented by the Type on that this attribute is applied.

<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">OpcDataTypeAttribute Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Defines the identifier of 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 OpcDataTypeAttribute : Attribute
```

</div>

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

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

</div>

## Inheritance

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

## Constructors

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

## Properties

| Name | Description |
|---|---|
| [Description](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#description)<span class="api-meta">since v2.8</span> | Gets or sets a human readable text that describes the data type. |
| [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#id) | Gets the node identifier used to define the data type node of the [Type](https://learn.microsoft.com/dotnet/api/system.type) to that the attribute has been applied. |
| [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#name)<span class="api-meta">since v2.32</span> | Gets or sets the name of the data type. |
| [NamespaceUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#namespaceuri)<span class="api-meta">since v2.13</span> | Gets or sets the URI (Uniform Resource Identifier) or string literal used to identify the namespace of the [Type](https://learn.microsoft.com/dotnet/api/system.type), to that the attribute has been applied, belongs to. |
| [UseDataTypeDefinition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#usedatatypedefinition)<span class="api-meta">since v2.26</span> | Gets or sets a value indicating whether the data type is to be declared in a custom data type definition. |
| [UseDataTypeDescription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#usedatatypedescription)<span class="api-meta">since v2.13</span> | Gets or sets a value indicating whether the data type is to be declared in a custom data type dictionary. |

## Methods

| Name | Description |
|---|---|
| [GetNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/members#getnamespace)<span class="api-meta">since v2.13</span> | Retrieves the [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) referenced to by the OpcDataTypeAttribute. |

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

## Applies to

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