UpdateOperationsUtility.AppendReplaceComponentOp(String, Dictionary<String,Object>) Method

Definition

Include a replace component operation. Learn more about managing digital twins here https://docs.microsoft.com/en-us/azure/iot-pnp/howto-manage-digital-twin.

public void AppendReplaceComponentOp (string path, System.Collections.Generic.Dictionary<string,object> propertyValues);
member this.AppendReplaceComponentOp : string * System.Collections.Generic.Dictionary<string, obj> -> unit
Public Sub AppendReplaceComponentOp (path As String, propertyValues As Dictionary(Of String, Object))

Parameters

path
System.String

The path to the component to be updated.

propertyValues
System.Collections.Generic.Dictionary<System.String,System.Object>

The dictionary of property key values pairs to update to.

Remarks

This utility appends the "$metadata" identifier to the property values, which helps the service identify this as a component update, and not a root-level property update.

The component patch should be in the following format: [ { "op": "replace", "path": "/sampleComponentName", "value": { "samplePropertyName": 20, "$metadata": {} } } ]

Applies to