ThingWorx Edge .NET SDK > ThingWorx Edge .NET SDK Reference > .NET SDK: VirtualThing Class > .NET SDK: Property Value Modifications
.NET SDK: Property Value Modifications
The VirtualThing class contains several methods that can be called to update the value of a property.
Updating a property value does not send the value to the ThingWorx platform. To send the value to the platform, you must call the updateSubscribedProperties() method of the VirtualThing class.
Methods for Modifying Property Values
The following table lists and briefly describes methods available for the VirtualThing class.
Set the value of a property, using a VTQ (value, time, and quality) structure:
name — The name of the property.
value — The VTQ (value, time, and quality) for the property’s value.
forceConnect — Set this value to true to force the value to be sent to the ThingWorx platform, even if it has not changed. This option is a good option for sending the first value or sending a value immediately after a reconnect.
Set the value of a property, using a primitive type:
name — The name of the property.
value — The primitive value.
Set the value of a property, using an object
name — The name of the property.
value — An object representing the value to set. The value is cast to the type of property if possible; otherwise, an exception is thrown.
The example below uses the methods to set new properties and update the values of existing properties.
Be sure to call the updateSubscribedProperties() method on the VirtualThing to send the property values to your ThingWorx platform. This functionality is also illustrated in the Steam Sensor Example for the .NET SDK.
VTQ vtq = new VTQ();
vtq.setValue(new NumberPrimitive(123.456));
vtq.setTime(new DateTime());
base.setPropertyVTQ("MyProperty", vtq);

NumberPrimitive value = new NumberPrimitive(123.456);
base.setPropertyValue("MyProperty", value);

base.setProperty("MyProperty", 123.456);