ICounterApiSet Method

Set the counter value.

Definition

Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
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