DataWeb
Search Results for

    Show / Hide Table of Contents

    Class SequentialValueStore

    SQL Server implementation of sequential value generation for auto-incrementing counters.

    Inheritance
    object
    SequentialValueStore
    Implements
    ISequentialValueStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DataWeb.Data.SqlServer
    Assembly: DataWeb.Data.SqlServer.dll
    Syntax
    public class SequentialValueStore : ISequentialValueStore

    Constructors

    SequentialValueStore(ISqlHelper)

    SQL Server implementation of sequential value generation for auto-incrementing counters.

    Declaration
    public SequentialValueStore(ISqlHelper sqlHelper)
    Parameters
    Type Name Description
    ISqlHelper sqlHelper

    Properties

    Name

    Gets the name of the sequential value store provider.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Methods

    GetNewValueAsync(string, CancellationToken)

    Increments and returns the next sequential value for a given counter name.

    Declaration
    public Task<int> GetNewValueAsync(string name, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string name

    The name of the sequential counter.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<int>

    The new incremented value.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when name is null or empty.

    InvalidOperationException

    Thrown when the sequential value name is not found in the database.

    SeedValueAsync(string, CancellationToken)

    Seeds a sequential counter with an initial value.

    Declaration
    public Task SeedValueAsync(string name, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string name

    The name of the sequential counter to seed.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    ArgumentException

    Thrown when name is null or empty.

    Implements

    ISequentialValueStore
    In this article
    Back to top Generated by DocFX