Click or drag to resize

ICounterApiSet Method

Set the counter value.

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
void Set(
	string name,
	int value
)

Parameters

name
Type: SystemString
Name of the counter.
value
Type: SystemInt32
The value.
Examples
var counterApi = ctx.Use<ICounterApi>();
// This example generates a new Order Number for the current year
counterApi.Next($"OrderNo"); // return 1
counterApi.Next($"OrderNo"); // return 2
counterApi.Set($"OrderNo", 1000); // set the counter value to 1000
counterApi.Next($"OrderNo"); // return 1001
See Also