# OpcDeleteReference Members

> Reference: Defines a single command of the IOpcDeleteReferencesService used to delete a logical reference between one and another node.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDeleteReference</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 [OpcNodeServiceCommand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcnodeservicecommand/members), [OpcServiceCommand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcservicecommand/members).

## Constructors

### OpcDeleteReference

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

| Overload | Description |
|---|---|
| [OpcDeleteReference(OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/members#opcdeletereference-opc-uafx-opcnodeid-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other. |
| [OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/members#opcdeletereference-opc-uafx-opcnodeid-opc-uafx-opcnodeid-system-nullable-of-opc-uafx-opcreferencedirection) | Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. |
| [OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/members#opcdeletereference-opc-uafx-opcnodeid-opc-uafx-opcnodeid-system-nullable-of-opc-uafx-opcreferencedirection-opc-uafx-opcreferencetype) | Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. |
| [OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/members#opcdeletereference-opc-uafx-opcnodeid-opc-uafx-opcnodeid-system-nullable-of-opc-uafx-opcreferencedirection-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. |

#### OpcDeleteReference(OpcNodeId, OpcNodeId)

Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other. The relation is deleted in bidirectional direction 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 OpcDeleteReference(OpcNodeId nodeId, OpcNodeId targetNodeId)
```

</div>

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

```vbnet
Public Sub New(nodeId As OpcNodeId, targetNodeId 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/) through that the source node can be identified and accessed. |
| `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/) through that the target node can be identified and accessed. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` or `targetNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` or `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?)

Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. The reference to delete have to be of the relation defined by `direction` using the [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 OpcDeleteReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcReferenceDirection? direction)
```

</div>

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

```vbnet
Public Sub New(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    direction As OpcReferenceDirection?)
```

</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/) through that the source node can be identified and accessed. |
| `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/) through that the target node can be identified and accessed. |
| `direction` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/)&gt; | One of the members defined by the [OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/) enumeration which defines the kind of relation of reference to delete or a null reference (Nothing in Visual Basic) in case there the relation is to be deleted in bidirectional direction. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` or `targetNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` or `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?, OpcReferenceType)

Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. The reference to delete have to be of the relation defined by `direction` using the `referenceType` specified as the type of reference.

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

```csharp
public OpcDeleteReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcReferenceDirection? direction,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Sub New(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    direction As OpcReferenceDirection?,
    referenceType As OpcReferenceType)
```

</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/) through that the source node can be identified and accessed. |
| `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/) through that the target node can be identified and accessed. |
| `direction` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/)&gt; | One of the members defined by the [OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/) enumeration which defines the kind of relation of reference to delete or a null reference (Nothing in Visual Basic) in case there the relation is to be deleted in bidirectional direction. |
| `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 reference between the source and the target node identified by the `nodeId` and the `targetNodeId`. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` or `targetNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` or `targetNodeId` is a null reference (Nothing in Visual Basic). |

#### OpcDeleteReference(OpcNodeId, OpcNodeId, OpcReferenceDirection?, OpcNodeId)

Initializes a new instance of the [OpcDeleteReference](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/) class using the identifiers of the nodes which shall not longer reference each other using the `direction` specified. The reference to delete have to be of the relation defined by `direction` using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcDeleteReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcReferenceDirection? direction,
    OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Sub New(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    direction As OpcReferenceDirection?,
    referenceTypeId 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/) through that the source node can be identified and accessed. |
| `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/) through that the target node can be identified and accessed. |
| `direction` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/)&gt; | One of the members defined by the [OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/) enumeration which defines the kind of relation of reference to delete or a null reference (Nothing in Visual Basic) in case there the relation is to be deleted in bidirectional direction. |
| `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 use to setup the reference between the source and the target node identified by the `nodeId` and the `targetNodeId`. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId`, `targetNodeId` or `referenceTypeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId`, `targetNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

## Properties

### Direction

Gets a value indicating the logical direction of the reference to delete.

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

```csharp
public OpcReferenceDirection? Direction { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Direction As OpcReferenceDirection?
```

</div>

**Property value**

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

One of the members defined by the [OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/) enumeration indicating which relation is to be deleted or a null reference (Nothing in Visual Basic) in case there the relations are to be deleted bidirectional. The default value is a null reference (Nothing in Visual Basic).

### ReferenceType

Gets a value which defines a pre-defined used [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletereference/members#referencetypeid) as one of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to simplify querying standard reference types.

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

```csharp
public OpcReferenceType ReferenceType { get; }
```

</div>

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

```vbnet
Public ReadOnly Property ReferenceType As OpcReferenceType
```

</div>

**Property value**

[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. The default value is [Organizes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#organizes).

### ReferenceTypeId

Gets the identifier which identifies the node that defines the semantic of the reference between the source and the target node and generally reflects an operation between the two, such as "A contains B".

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

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

</div>

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

```vbnet
Public ReadOnly Property ReferenceTypeId 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).

### TargetNodeId

Gets the identifier which identifies the target node which acts as the opponent in the reference to delete between the source node (identified by [NodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcnodeservicecommand/members#nodeid)) the target node.

<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/) of the target node acting as the opponent of the reference to delete.
