SharedData Decrement Method C# API
Decrements an integer value associated with the specified key in the Shared Data Server.

Namespace: Facilita.Fc.Runtime
Assembly: fc_clr (in fc_clr.dll) Version:

public int Decrement(
	string key,
	int inc


Type: System String
The key against which the value to be decremented is stored.
Type: System Int32
The amount by which to decrement.

Return Value

The new, decremented value.

The specified key must already be associated with a value, which can be set by calling Set(String, String) or SetInt(String, Int32). If the value associated with key is not a decrementable value then no action takes place.

A negative decrement value can be supplied.

Note Note
The keys are case-sensitive.


The following example demonstrates decrementing a value in the Shared Data Server.
using Facilita.Fc.Runtime;
SharedData sharedData = new SharedData(GetString("sharedDataHost", "localhost"), GetInt("sharedDataPort", 5099));
sharedData.Set("Count", "100");
sharedData.Decrement("Count");   // value will = 99
sharedData.Decrement("Count", 7);   // value will = 92
See Also