Table of Contents

Class SequenceBuilder

Namespace
Microsoft.EntityFrameworkCore.Metadata.Builders
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Provides a simple API for configuring a ISequence.

public class SequenceBuilder : IInfrastructure<IConventionSequenceBuilder>
Inheritance
SequenceBuilder
Implements
Inherited Members

Constructors

SequenceBuilder(IMutableSequence)

Creates a new builder for the given ISequence.

public SequenceBuilder(IMutableSequence sequence)

Parameters

sequence IMutableSequence

The IMutableSequence to configure.

Properties

Metadata

The sequence.

public virtual IMutableSequence Metadata { get; }

Property Value

IMutableSequence

Methods

HasMax(long)

Sets the maximum value for the ISequence.

public virtual SequenceBuilder HasMax(long maximum)

Parameters

maximum long

The maximum value for the sequence.

Returns

SequenceBuilder

The same builder so that multiple calls can be chained.

HasMin(long)

Sets the minimum value for the ISequence.

public virtual SequenceBuilder HasMin(long minimum)

Parameters

minimum long

The minimum value for the sequence.

Returns

SequenceBuilder

The same builder so that multiple calls can be chained.

IncrementsBy(int)

Sets the ISequence to increment by the given amount when generating each next value.

public virtual SequenceBuilder IncrementsBy(int increment)

Parameters

increment int

The amount to increment between values.

Returns

SequenceBuilder

The same builder so that multiple calls can be chained.

IsCyclic(bool)

Sets whether or not the sequence will start again from the beginning once the maximum value is reached.

public virtual SequenceBuilder IsCyclic(bool cyclic = true)

Parameters

cyclic bool

If true, then the sequence will restart when the maximum is reached.

Returns

SequenceBuilder

The same builder so that multiple calls can be chained.

StartsAt(long)

Sets the ISequence to start at the given value.

public virtual SequenceBuilder StartsAt(long startValue)

Parameters

startValue long

The starting value for the sequence.

Returns

SequenceBuilder

The same builder so that multiple calls can be chained.