# OpcDeleteNode Members

> Reference: Defines a single command of the IOpcDeleteNodesService used to delete one node.

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

### OpcDeleteNode

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

| Overload | Description |
|---|---|
| [OpcDeleteNode(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/members#opcdeletenode-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) class using the identifier of the node which shall be deleted including the references where the node acts as the source and as the target of the reference. |
| [OpcDeleteNode(OpcNodeId, bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/members#opcdeletenode-opc-uafx-opcnodeid-system-boolean) | Initializes a new instance of the [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) class using the identifier of the node which shall be deleted including the references where the node acts as the source and optionally (see `includeTargetReferences`) as the target of the reference. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` 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` is a null reference (Nothing in Visual Basic). |

#### OpcDeleteNode(OpcNodeId)

Initializes a new instance of the [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) class using the identifier of the node which shall be deleted including the references where the node acts as the source and as the target of the reference.

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

```csharp
public OpcDeleteNode(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/) through that the node to delete can be identified and accessed. |

#### OpcDeleteNode(OpcNodeId, bool)

Initializes a new instance of the [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) class using the identifier of the node which shall be deleted including the references where the node acts as the source and optionally (see `includeTargetReferences`) as the target of the reference.

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

```csharp
public OpcDeleteNode(OpcNodeId nodeId, bool includeTargetReferences)
```

</div>

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

```vbnet
Public Sub New(nodeId As OpcNodeId, includeTargetReferences As Boolean)
```

</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 node to delete can be identified and accessed. |
| `includeTargetReferences` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | A value indicating whether all references there the node being deleted acts as the target shall be deleted as well. The value true if all references using the node to delete as the target of the reference shall be deleted as well; otherwise the value false which indicates that only references there the node to delete acts as the source of the reference. |

## Properties

### IncludeTargetReferences

Gets a value indicating whether all references there the node being deleted acts as the target shall be deleted as well.

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

```csharp
public bool IncludeTargetReferences { get; }
```

</div>

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

```vbnet
Public ReadOnly Property IncludeTargetReferences As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if all references using the node to delete as the target of the reference shall be deleted as well (the default value); otherwise the value false which indicates that only references there the node to delete acts as the source of the reference.
