Class UniqueSequence
Generates a unique sequence of numbers stored in the database
Inheritance
System.Object
UniqueSequence
Namespace: EPiServer.DataAbstraction.Internal
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class UniqueSequence : Object
Remarks
This class is stateless so two instances refering to the same sequence name will work the same as one instance of the class
Constructors
UniqueSequence(String)
Default constructor defining the name of the sequence
Declaration
public UniqueSequence(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the sequence |
Remarks
New sequence names will automatically create a new sequence starting at one(1)
Methods
Next()
Move sequence forward one step
Declaration
public virtual long Next()
Returns
Type | Description |
---|---|
System.Int64 | The next number in the sequence |
Next(Int64)
Move sequence forwards with specified number of steps
Declaration
public virtual long Next(long numberOfSteps)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | numberOfSteps | The numer of steps with a minimum of one(1) |
Returns
Type | Description |
---|---|
System.Int64 | The last number in the sequence where the starting number in the sequence is returnValue-(numberOfSteps-1) |