# OpcNodeReferenceCollection Class

> Reference: Provides a collection of OpcNodeReference instances where the NodeId is used as the key of each entry.

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

Provides a collection of [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances where the [NodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/members#nodeid) is used as the key of each entry.

## Syntax

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

```csharp
public class OpcNodeReferenceCollection : KeyedCollection<OpcNodeId, OpcNodeReference>
```

</div>

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

```vbnet
Public Class OpcNodeReferenceCollection
    Inherits KeyedCollection(Of OpcNodeId, OpcNodeReference)
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [Collection](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1)&lt;[OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)&gt; → [KeyedCollection](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2)&lt;[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/), [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/)&gt; → **OpcNodeReferenceCollection**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a href="../opc.uafx.opcnodereference/">OpcNodeReference</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a href="../opc.uafx.opcnodereference/">OpcNodeReference</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;<a href="../opc.uafx.opcnodereference/">OpcNodeReference</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a href="../opc.uafx.opcnodereference/">OpcNodeReference</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1">IReadOnlyList</a>&lt;<a href="../opc.uafx.opcnodereference/">OpcNodeReference</a>&gt;</li>
</ul>

## Constructors

| Name | Description |
|---|---|
| [OpcNodeReferenceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencecollection/members#opcnodereferencecollection) | Initializes a new instance of the OpcNodeReferenceCollection class. |

## Methods

| Name | Description |
|---|---|
| [Add](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencecollection/members#add)<span class="api-meta">12 overloads</span> | Adds [OpcNodeReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereference/) instances representing a bidirectional relation between the `sourceNode` and the node identified by the `targetNodeId` specified. |
| [GetKeyForItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencecollection/members#getkeyforitem)<span class="api-meta">protected · override</span> | Extracts the key from the specified element. |

Inherits members from [KeyedCollection&lt;OpcNodeId, OpcNodeReference&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2), [Collection&lt;OpcNodeReference&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1).

## Applies to

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