# OpcNodeReferenceSource Members

> Reference: Provides a set of methods to construct OpcNodeReference instances using different source node information.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcNodeReferenceSource</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>

## Constructors

### OpcNodeReferenceSource

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [OpcNodeReferenceSource(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#opcnodereferencesource-opc-uafx-iopcnode) | Initializes a new instance of the [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) class using the `node` specified from which the references constructed originate from. |
| [OpcNodeReferenceSource(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#opcnodereferencesource-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) class using the `nodeId` to identify the node from which the references constructed originate from. |

#### OpcNodeReferenceSource(IOpcNode)

Initializes a new instance of the [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) class using the `node` specified from which the references constructed originate from.

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

```csharp
public OpcNodeReferenceSource(IOpcNode node)
```

</div>

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

```vbnet
Public Sub New(node As IOpcNode)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the source node of the references constructed. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `node` is a null reference (Nothing in Visual Basic). |

#### OpcNodeReferenceSource(OpcNodeId)

Initializes a new instance of the [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) class using the `nodeId` to identify the node from which the references constructed originate from.

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

```csharp
public OpcNodeReferenceSource(OpcNodeId nodeId)
```

</div>

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

```vbnet
Public Sub New(nodeId As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the source node of the references constructed. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

## Properties

### Node

Gets the node from which the references constructed originate from.

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

```csharp
public IOpcNode Node { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Node As IOpcNode
```

</div>

**Property value**

[IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/)

The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) which is used as the source node of the references constructed or a null refernce (Nothing in Visual Basic) in case there this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) has been initialized using a [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node the references shall originate from.

### NodeId

Gets the identifier of the node from which the references constructred originate from.

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

```csharp
public OpcNodeId NodeId { get; }
```

</div>

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

```vbnet
Public ReadOnly Property NodeId As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node from which the references constructed originate from.

## Methods

### To

<span class="api-meta">8 overloads</span>

| Overload | Description |
|---|---|
| [To(IEnumerable&lt;OpcReference&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-system-collections-generic-ienumerable-of-opc-uafx-opcreference) | Provides a node / references bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified. |
| [To(params OpcReference\[\])](#to-opc-uafx-opcreference-array) | Provides a node / references bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified. |
| [To(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-iopcnode) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the references. |
| [To(IOpcNode, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-iopcnode-opc-uafx-opcreferencetype) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [To(IOpcNode, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-iopcnode-opc-uafx-opcnodeid) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [To(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-opcnodeid) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the references. |
| [To(OpcNodeId, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-opcnodeid-opc-uafx-opcreferencetype) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |
| [To(OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#to-opc-uafx-opcnodeid-opc-uafx-opcnodeid) | Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |

#### To(IEnumerable&lt;OpcReference&gt;)

Provides a node / references bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified.

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

```csharp
public OpcNodeReference To(IEnumerable<OpcReference> references)
```

</div>

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

```vbnet
Public Function [To](
    references As IEnumerable(Of OpcReference)) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `references` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreference/)&gt; | A sequence of [OpcReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreference/) instances to associate with the node information refered to in this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/). |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which combines the node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified.

#### To(params OpcReference\[\])

Provides a node / references bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified.

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

```csharp
public OpcNodeReference To(params OpcReference[] references)
```

</div>

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

```vbnet
Public Function [To](
    ParamArray references As OpcReference()) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `references` | params [OpcReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreference/)[] | An array of [OpcReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreference/) instances to associate with the node information refered to in this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/). |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which combines the node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `references` specified.

#### To(IOpcNode)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the references. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReferenceSet To(IOpcNode targetNode)
```

</div>

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

```vbnet
Public Function [To](targetNode As IOpcNode) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the target one reference will cease in, while the second reference uses it the other way round. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### To(IOpcNode, OpcReferenceType)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReferenceSet To(
    IOpcNode targetNode,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function [To](
    targetNode As IOpcNode,
    referenceType As OpcReferenceType) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the target one reference will cease in, while the second reference uses it the other way round. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### To(IOpcNode, OpcNodeId)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReferenceSet To(IOpcNode targetNode, OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function [To](
    targetNode As IOpcNode,
    referenceTypeId As OpcNodeId) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the target one reference will cease in, while the second reference uses it the other way round. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the `targetNode` and its opponent. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

#### To(OpcNodeId)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the references. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReferenceSet To(OpcNodeId targetNodeId)
```

</div>

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

```vbnet
Public Function [To](targetNodeId As OpcNodeId) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node used as the target one reference will cease in, while the second reference uses it the other way round. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### To(OpcNodeId, OpcReferenceType)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReferenceSet To(
    OpcNodeId targetNodeId,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function [To](
    targetNodeId As OpcNodeId,
    referenceType As OpcReferenceType) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node used as the target one reference will cease in, while the second reference uses it the other way round. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` or `referenceType` is a null reference (Nothing in Visual Basic). |

#### To(OpcNodeId, OpcNodeId)

Provides a set of node / reference bundles in a new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The references created represent a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) and [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReferenceSet To(OpcNodeId targetNodeId, OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function [To](
    targetNodeId As OpcNodeId,
    referenceTypeId As OpcNodeId) As OpcNodeReferenceSet
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node used as the target one reference will cease in, while the second reference uses it the other way round. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the target identified by the `targetNodeId` and its opponent. |

**Returns**

[OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/)

A new instance of the [OpcNodeReferenceSet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferenceset/) class which owns two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the node refered to by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

### ToChild

<span class="api-meta">6 overloads</span>

| Overload | Description |
|---|---|
| [ToChild(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-iopcnode) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToChild(IOpcNode, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-iopcnode-opc-uafx-opcreferencetype) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToChild(IOpcNode, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-iopcnode-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToChild(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |
| [ToChild(OpcNodeId, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-opcnodeid-opc-uafx-opcreferencetype) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |
| [ToChild(OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#tochild-opc-uafx-opcnodeid-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |

#### ToChild(IOpcNode)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReference ToChild(IOpcNode targetNode)
```

</div>

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

```vbnet
Public Function ToChild(targetNode As IOpcNode) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### ToChild(IOpcNode, OpcReferenceType)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReference ToChild(
    IOpcNode targetNode,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function ToChild(
    targetNode As IOpcNode,
    referenceType As OpcReferenceType) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### ToChild(IOpcNode, OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReference ToChild(IOpcNode targetNode, OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function ToChild(
    targetNode As IOpcNode,
    referenceTypeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the `targetNode` and its opponent. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

#### ToChild(OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReference ToChild(OpcNodeId targetNodeId)
```

</div>

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

```vbnet
Public Function ToChild(targetNodeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### ToChild(OpcNodeId, OpcReferenceType)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReference ToChild(
    OpcNodeId targetNodeId,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function ToChild(
    targetNodeId As OpcNodeId,
    referenceType As OpcReferenceType) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### ToChild(OpcNodeId, OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ParentToChild](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#parenttochild) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReference ToChild(
    OpcNodeId targetNodeId,
    OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function ToChild(
    targetNodeId As OpcNodeId,
    referenceTypeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the target identified by the `targetNodeId` and its opponent. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

### ToParent

<span class="api-meta">6 overloads</span>

| Overload | Description |
|---|---|
| [ToParent(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-iopcnode) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToParent(IOpcNode, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-iopcnode-opc-uafx-opcreferencetype) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToParent(IOpcNode, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-iopcnode-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. |
| [ToParent(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |
| [ToParent(OpcNodeId, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-opcnodeid-opc-uafx-opcreferencetype) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |
| [ToParent(OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/members#toparent-opc-uafx-opcnodeid-opc-uafx-opcnodeid) | Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. |

#### ToParent(IOpcNode)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReference ToParent(IOpcNode targetNode)
```

</div>

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

```vbnet
Public Function ToParent(targetNode As IOpcNode) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### ToParent(IOpcNode, OpcReferenceType)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReference ToParent(
    IOpcNode targetNode,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function ToParent(
    targetNode As IOpcNode,
    referenceType As OpcReferenceType) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` is a null reference (Nothing in Visual Basic). |

#### ToParent(IOpcNode, OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` as the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReference ToParent(IOpcNode targetNode, OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function ToParent(
    targetNode As IOpcNode,
    referenceTypeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNode` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) in which the reference constructed ceases. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the `targetNode` and its opponent. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNode` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNode` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

#### ToParent(OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes) as the type of reference.

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

```csharp
public OpcNodeReference ToParent(OpcNodeId targetNodeId)
```

</div>

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

```vbnet
Public Function ToParent(targetNodeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### ToParent(OpcNodeId, OpcReferenceType)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the `referenceType` as the type of reference.

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

```csharp
public OpcNodeReference ToParent(
    OpcNodeId targetNodeId,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function ToParent(
    targetNodeId As OpcNodeId,
    referenceType As OpcReferenceType) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the type of reference represented. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### ToParent(OpcNodeId, OpcNodeId)

Provides a node / reference bundle in a new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class using the source node information of this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the `targetNodeId` as the identifier of the target of the reference. The reference created represents a [ChildToParent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/#childtoparent) relation using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcNodeReference ToParent(
    OpcNodeId targetNodeId,
    OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function ToParent(
    targetNodeId As OpcNodeId,
    referenceTypeId As OpcNodeId) As OpcNodeReference
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `targetNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the node in which the reference constructed ceases. |
| `referenceTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the type of reference to represent between the target identified by the `targetNodeId` and its opponent. |

**Returns**

[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)

A new instance of the [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) class which represents a unidirectional relation between the node referenced by this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/) and the node identified by the `targetNodeId` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `targetNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

### ToString

<span class="api-meta">override</span>

Returns a string representing the information contained in the [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/).

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string which describes the information in this [OpcNodeReferenceSource](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencesource/).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
