# OpcBidirectionalReference Members

> Reference: Describes a bidirectional reference from a logical 'parent' to a logical 'child' AND vice versa using a specific type of reference between the two opponents.

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

### OpcBidirectionalReference

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

| Overload | Description |
|---|---|
| [OpcBidirectionalReference(IOpcNode, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#opcbidirectionalreference-opc-uafx-iopcnode-opc-uafx-opcreferencetype) | Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNode` as the target of the reference and using the value of the `type` parameter as the type of reference. |
| [OpcBidirectionalReference(IOpcNode, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#opcbidirectionalreference-opc-uafx-iopcnode-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNode` as the target using the type of reference identified by the `typeId` specified. |
| [OpcBidirectionalReference(OpcNodeId, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#opcbidirectionalreference-opc-uafx-opcnodeid-opc-uafx-opcreferencetype) | Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNodeId` as the identifier of the target of the reference using the value of the `type` parameter as the type of the reference. |
| [OpcBidirectionalReference(OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#opcbidirectionalreference-opc-uafx-opcnodeid-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNodeId` as the identifier of the target and using the type of reference identified by the `typeId` specified. |

#### OpcBidirectionalReference(IOpcNode, OpcReferenceType)

Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNode` as the target of the reference and using the value of the `type` parameter as the type of reference.

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

```csharp
public OpcBidirectionalReference(IOpcNode targetNode, OpcReferenceType type)
```

</div>

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

```vbnet
Public Sub New(targetNode As IOpcNode, type As OpcReferenceType)
```

</div>

**Parameters**

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

**Exceptions**

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

#### OpcBidirectionalReference(IOpcNode, OpcNodeId)

Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNode` as the target using the type of reference identified by the `typeId` specified.

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

```csharp
public OpcBidirectionalReference(IOpcNode targetNode, OpcNodeId typeId)
```

</div>

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

```vbnet
Public Sub New(targetNode As IOpcNode, typeId As OpcNodeId)
```

</div>

**Parameters**

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

**Exceptions**

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

#### OpcBidirectionalReference(OpcNodeId, OpcReferenceType)

Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNodeId` as the identifier of the target of the reference using the value of the `type` parameter as the type of the reference.

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

```csharp
public OpcBidirectionalReference(OpcNodeId targetNodeId, OpcReferenceType type)
```

</div>

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

```vbnet
Public Sub New(targetNodeId As OpcNodeId, type As OpcReferenceType)
```

</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. |
| `type` | [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. |

**Exceptions**

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

#### OpcBidirectionalReference(OpcNodeId, OpcNodeId)

Initializes a new instance of the [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) class using the `targetNodeId` as the identifier of the target and using the type of reference identified by the `typeId` specified.

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

```csharp
public OpcBidirectionalReference(OpcNodeId targetNodeId, OpcNodeId typeId)
```

</div>

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

```vbnet
Public Sub New(targetNodeId As OpcNodeId, typeId As OpcNodeId)
```

</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. |
| `typeId` | [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. |

**Exceptions**

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

## Properties

### TargetNode

Gets the node to which the reference refers to.

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

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

</div>

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

```vbnet
Public ReadOnly Property TargetNode 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/) to which the reference refers to or a null refernce (Nothing in Visual Basic) in case there this [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) 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 reference refers to.

### TargetNodeId

Gets the identifier of the node to which the reference refers to.

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

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

</div>

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

```vbnet
Public ReadOnly Property TargetNodeId 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 to which the reference refers to.

### Type

Gets a value which defines the pre-defined type of reference represented.

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

```csharp
public OpcReferenceType? Type { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Type As OpcReferenceType?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/)&gt;

One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration or a null reference (Nothing in Visual Basic) if [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#typeid) refers to a type of reference which is not a built in reference type. The default value is [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes).

### TypeId

Gets the identifier which identifies the node that defines the semantic of the reference between the source and the target node represented through this [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/) and generally reflects an operation between the two, such as "A contains B" and vice versa.

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

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

</div>

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

```vbnet
Public ReadOnly Property TypeId 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/) of the reference type node which defines the relation semantic between the source and the target node. The default value is [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetypes/members#organizes).

## Methods

### GetReferences

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

| Overload | Description |
|---|---|
| [GetReferences()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#getreferences-noparams) | Retrieves an empty sequence of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances. |
| [GetReferences(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#getreferences-opc-uafx-iopcnode) | Retrieves a sequence with two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances using the `node` specified as the source and target of the references. |
| [GetReferences(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/members#getreferences-opc-uafx-opcnodeid) | Retrieves a sequence with two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances using the `nodeId` specified as the source and target of the references. |

#### GetReferences()

Retrieves an empty sequence of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances.

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

```csharp
public IEnumerable<OpcNodeReference> GetReferences()
```

</div>

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

```vbnet
Public Function GetReferences() As IEnumerable(Of OpcNodeReference)
```

</div>

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)&gt;

An empty [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances.

**Implements**

[GetReferences](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodereferenceaware/members#getreferences-noparams)

#### GetReferences(IOpcNode)

Retrieves a sequence with two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances using the `node` specified as the source and target of the references.

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

```csharp
public IEnumerable<OpcNodeReference> GetReferences(IOpcNode node)
```

</div>

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

```vbnet
Public Function GetReferences(
    node As IOpcNode) As IEnumerable(Of OpcNodeReference)
```

</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/) instance from which one [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instance will originate from and in which one will cease. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances which contains two instances.

**Exceptions**

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

**Implements**

[GetReferences](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodereferenceaware/members#getreferences-opc-uafx-iopcnode)

#### GetReferences(OpcNodeId)

Retrieves a sequence with two [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances using the `nodeId` specified as the source and target of the references.

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

```csharp
public IEnumerable<OpcNodeReference> GetReferences(OpcNodeId nodeId)
```

</div>

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

```vbnet
Public Function GetReferences(
    nodeId As OpcNodeId) As IEnumerable(Of OpcNodeReference)
```

</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 node from which one [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instance will originate from and in which one will cease. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances which contains two instances.

**Exceptions**

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

**Implements**

[GetReferences](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodereferenceaware/members#getreferences-opc-uafx-opcnodeid)

### ToString

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

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

<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 [OpcBidirectionalReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcbidirectionalreference/).

**Overrides**

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