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.5.0
Syntax
C#
void Set(
	string name,
	int value
)

Parameters

name  String
Name of the counter.
value  Int32
The value.
Example
C#
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