SequentialGuidValueGenerator Class

Definition

Generates sequential Guid values optimized for use in Microsoft SQL server clustered keys or indexes, yielding better performance than random values. This is the default generator for SQL Server Guid columns which are set to be generated on add.

See https://docs.microsoft.com/sql/t-sql/functions/newsequentialid-transact-sql. Although this generator achieves the same goals as SQL Server's NEWSEQUENTIALID, the algorithm used to generate the GUIDs is different.

The generated values are non-temporary, meaning they will be saved to the database.

public class SequentialGuidValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator<Guid>
type SequentialGuidValueGenerator = class
    inherit ValueGenerator<Guid>
Public Class SequentialGuidValueGenerator
Inherits ValueGenerator(Of Guid)
Inheritance
SequentialGuidValueGenerator

Constructors

SequentialGuidValueGenerator()

Properties

GeneratesTemporaryValues

Gets a value indicating whether the values generated are temporary or permanent. This implementation always returns false, meaning the generated values will be saved to the database.

Methods

Next(EntityEntry)

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>)

Applies to