Class UniqueSequence
Generates a unique sequence of numbers stored in the database
Inheritance
System.Object
UniqueSequence
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 9.12.2Syntax
public class UniqueSequence
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) |