Updating relationship properties
In some scenarios, the properties of relationships need to be updated. Updating properties can be done using the JsonPatchDocument
class. This class allows us to execute several changes for properties at once. In this example, we will be updating one property at a time.
Create a new method for updating a relationship. Add the following code to the DigitalTwinsManager
class:
public void UpdateRelationship(string twinSourceId, string twinDestinationId, string property, object value) { string relationShipId = RelationshipId(twinSourceId, twinDestinationId); JsonPatchDocument patch = null; try { patch = new JsonPatchDocument(); patch.AppendReplace("/" + property, value); client.UpdateRelationship(twinSourceId...