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
-
IInfrastructure<IConventionSequenceBuilder>
- Inherited Members
Constructors
SequenceBuilder(IMutableSequence)
Creates a new builder for the given ISequence.
public SequenceBuilder(IMutableSequence sequence)
Parameters
sequenceIMutableSequenceThe IMutableSequence to configure.
Properties
Metadata
The sequence.
public virtual IMutableSequence Metadata { get; }
Property Value
Methods
HasMax(long)
Sets the maximum value for the ISequence.
public virtual SequenceBuilder HasMax(long maximum)
Parameters
maximumlongThe 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
minimumlongThe 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
incrementintThe 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
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
startValuelongThe starting value for the sequence.
Returns
- SequenceBuilder
The same builder so that multiple calls can be chained.