Share via


HiLoValueGenerator<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.

public abstract class HiLoValueGenerator<TValue> : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<TValue>
type HiLoValueGenerator<'Value> = class
    inherit ValueGenerator<'Value>
Public MustInherit Class HiLoValueGenerator(Of TValue)
Inherits ValueGenerator(Of TValue)

Type Parameters

TValue

The type of values that are generated.

Inheritance
HiLoValueGenerator<TValue>

Remarks

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.

Constructors

HiLoValueGenerator<TValue>(HiLoValueGeneratorState)

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

Properties

GeneratesStableValues

Gets a value indicating whether the values generated are stable. That is, the value will always be the same for a given property in a given entity, and does not depend on what other values may have been generated previously. For example, discriminator values generated for a TPH hierarchy are stable. Stable values will never be marked as unknown.

(Inherited from ValueGenerator)
GeneratesTemporaryValues

Gets a value indicating whether the values generated are temporary (i.e they should be replaced by database generated values when the entity is saved) or are permanent (i.e. the generated values should be saved to the database).

(Inherited from ValueGenerator)

Methods

GetNewLowValue()

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

GetNewLowValueAsync(CancellationToken)

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

Next(EntityEntry)

Gets a value to be assigned to a property.

NextAsync(EntityEntry, CancellationToken)

Gets a value to be assigned to a property.

NextAsync(EntityEntry, CancellationToken)

Template method to be overridden by implementations to perform value generation.

(Inherited from ValueGenerator<TValue>)
NextValue(EntityEntry)

Gets a value to be assigned to a property.

(Inherited from ValueGenerator<TValue>)
NextValueAsync(EntityEntry, CancellationToken)

Gets a value to be assigned to a property.

(Inherited from ValueGenerator<TValue>)
WithConverter(ValueConverter)

Wraps this ValueGenerator such that it processes values converted with the given ValueConverter.

(Inherited from ValueGenerator)

Applies to