Hi​Lo​Value​Generator<​TValue> Hi​Lo​Value​Generator(​Of ​TValue) Class

Definition

Acts as a ValueGenerator by requesting a block of values from the underlying database and returning them one by one. Will ask the underlying database for another block when the current block is exhausted.

A block is represented by a low value fetched from the database, and then a block size that indicates how many sequential values can be used, starting from the low value, before a new low value must be fetched from the database.

public abstract class HiLoValueGenerator<TValue> : ValueGenerator<TValue>Public MustInherit Class HiLoValueGenerator(Of TValue)
    Inherits ValueGenerator(Of TValue)
Type Parameters
TValue

The type of values that are generated.

Inheritance
System.ObjectSystem.Object
ValueGenerator<TValue>ValueGenerator(Of TValue)
HiLoValueGenerator<TValue>HiLoValueGenerator(Of TValue)

Inherited Members

Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator{{TValue}}

NextValueAsync(EntityEntry, System.Threading.CancellationToken)NextValueAsync(EntityEntry, System.Threading.CancellationToken)

Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator

System.Object

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

Constructors

HiLoValueGenerator(HiLoValueGeneratorState) HiLoValueGenerator(HiLoValueGeneratorState)

Initializes a new instance of the HiLoValueGenerator<TValue> class.

protected HiLoValueGenerator(HiLoValueGeneratorState generatorState)Protected Sub New(generatorState As HiLoValueGeneratorState)
Parameters
generatorState
HiLoValueGeneratorState HiLoValueGeneratorState

The state used to keep track of which value to return next.

Methods

GetNewLowValue() GetNewLowValue()

Gets the low value for the next block of values to be used.

protected abstract long GetNewLowValue()Protected MustOverride Function GetNewLowValue As Long
Returns
System.Int64 System.Int64

The low value for the next block of values to be used.

GetNewLowValueAsync(CancellationToken) GetNewLowValueAsync(CancellationToken)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

protected virtual Task<long> GetNewLowValueAsync(CancellationToken cancellationToken = null)Protected Overridable Function GetNewLowValueAsync(cancellationToken As CancellationToken = Nothing) As Task(Of Long)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<System.Int64> System.Threading.Tasks.Task(Of System.Int64)

Next(EntityEntry) Next(EntityEntry)

Gets a value to be assigned to a property.

public override TValue Next(EntityEntry entry)Public Overrides Function Next(entry As EntityEntry) As TValue
Parameters
Returns
TValue TValue

The value to be assigned to a property.

Overrides
Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<TValue>.Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry)Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<TValue>.Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry)

NextAsync(EntityEntry, CancellationToken) NextAsync(EntityEntry, CancellationToken)

Gets a value to be assigned to a property.

public override Task<TValue> NextAsync(EntityEntry entry, CancellationToken cancellationToken = null)Public Overrides Function NextAsync(entry As EntityEntry, cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<TValue> System.Threading.Tasks.Task(Of TValue)

The value to be assigned to a property.

Overrides
Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<TValue>.NextAsync(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry, System.Threading.CancellationToken)Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<TValue>.NextAsync(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry, System.Threading.CancellationToken)