# OpcDataTypeMapperAttribute Members

> Reference: Defines data type mappings supported by an implementation of the IOpcDataTypeMapper interface.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDataTypeMapperAttribute</a></dd>
<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>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

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

## Constructors

### OpcDataTypeMapperAttribute

Initializes a new instance of the [OpcDataTypeMapperAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/) class using the `sourceType` and `targetType` supported by the data type mapper.

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

```csharp
public OpcDataTypeMapperAttribute(Type sourceType, Type targetType)
```

</div>

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

```vbnet
Public Sub New(sourceType As Type, targetType As Type)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `sourceType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) of [object](https://learn.microsoft.com/dotnet/api/system.object) which is to be mapped to the `targetType`. |
| `targetType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) to which the `sourceType` is to be mapped. |

## Properties

### SourceType

Gets the [Type](https://learn.microsoft.com/dotnet/api/system.type) from an [object](https://learn.microsoft.com/dotnet/api/system.object) can be mapped to the [TargetType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/members#targettype) using the mapper this attribute applies to.

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

```csharp
public Type SourceType { get; }
```

</div>

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

```vbnet
Public ReadOnly Property SourceType As Type
```

</div>

**Property value**

[Type](https://learn.microsoft.com/dotnet/api/system.type)

The [Type](https://learn.microsoft.com/dotnet/api/system.type) which can be mapped.

### TargetType

Gets the [Type](https://learn.microsoft.com/dotnet/api/system.type) to that an [object](https://learn.microsoft.com/dotnet/api/system.object) is mapped using this mapper this attribute applies to.

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

```csharp
public Type TargetType { get; }
```

</div>

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

```vbnet
Public ReadOnly Property TargetType As Type
```

</div>

**Property value**

[Type](https://learn.microsoft.com/dotnet/api/system.type)

The resulting [Type](https://learn.microsoft.com/dotnet/api/system.type) after mapping an [object](https://learn.microsoft.com/dotnet/api/system.object) of the [SourceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/members#sourcetype).
