HiLoValueGeneratorState HiLoValueGeneratorState Class

The thread safe state used by HiLoValueGenerator<TValue>.

Syntax

Declaration

public class HiLoValueGeneratorStatePublic Class HiLoValueGeneratorState

Inheritance Hierarchy

  • System.Object
    System.Object
  • HiLoValueGeneratorState
    HiLoValueGeneratorState

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Initializes a new instance of the HiLoValueGeneratorState class.

Methods summary

Gets a value to be assigned to a property.

Gets a value to be assigned to a property.

Constructors

  • HiLoValueGeneratorState(Int32)
    HiLoValueGeneratorState(Int32)

    Initializes a new instance of the HiLoValueGeneratorState class.

    public HiLoValueGeneratorState(int blockSize)Public Sub New(blockSize As Integer)

    Parameters

    • blockSize
      System.Int32
      System.Int32

      The number of sequential values that can be used, starting from the low value, before a new low value must be fetched from the database.

Methods

  • Next<TValue>(Func<Int64>)
    Next(Of TValue)(Func(Of Int64))

    Gets a value to be assigned to a property.

    public virtual TValue Next<TValue>(Func<long> getNewLowValue)Public Overridable Function Next(Of TValue)(getNewLowValue As Func(Of Long)) As TValue

    Parameters

    • getNewLowValue
      System.Func<TResult><System.Int64>
      System.Func<TResult>(Of System.Int64)

      A function to get the next low value if needed.

    Returns

    • TValue
      TValue

      The value to be assigned to a property.

  • NextAsync<TValue>(Func<CancellationToken, Task<Int64>>, CancellationToken)
    NextAsync(Of TValue)(Func(Of CancellationToken, Task(Of Int64)), CancellationToken)

    Gets a value to be assigned to a property.

    public virtual Task<TValue> NextAsync<TValue>(Func<CancellationToken, Task<long>> getNewLowValue, CancellationToken cancellationToken = null)Public Overridable Function NextAsync(Of TValue)(getNewLowValue As Func(Of CancellationToken, Task(Of Long)), cancellationToken As CancellationToken = Nothing) As Task(Of TValue)

    Parameters

    • getNewLowValue
      System.Func<T, TResult><System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult><System.Int64>>
      System.Func<T, TResult>(Of System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>(Of System.Int64))

      A function to get the next low value if needed.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TValue>
      System.Threading.Tasks.Task<TResult>(Of TValue)

      The value to be assigned to a property.

Details

Assembly

Microsoft.EntityFrameworkCore.dll