Table of Contents

Interface IConventionSequenceBuilder

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

Provides a simple API for configuring a IConventionSequence.

public interface IConventionSequenceBuilder : IConventionAnnotatableBuilder

Remarks

See Model building conventions for more information and examples.

Properties

Metadata

The sequence being configured.

IConventionSequence Metadata { get; }

Property Value

IConventionSequence

Methods

CanSetIncrementsBy(int?, bool)

Returns a value indicating whether the given increment can be set for the sequence.

bool CanSetIncrementsBy(int? increment, bool fromDataAnnotation = false)

Parameters

increment int?

The amount to increment between values.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given increment can be set for the sequence.

CanSetIsCyclic(bool?, bool)

Returns a value indicating whether the given cyclicity can be set for the sequence.

bool CanSetIsCyclic(bool? cyclic, bool fromDataAnnotation = false)

Parameters

cyclic bool?

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

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given cyclicity can be set for the sequence.

CanSetMax(long?, bool)

Returns a value indicating whether the given maximum value can be set for the sequence.

bool CanSetMax(long? maximum, bool fromDataAnnotation = false)

Parameters

maximum long?

The maximum value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given maximum value can be set for the sequence.

CanSetMin(long?, bool)

Returns a value indicating whether the given minimum value can be set for the sequence.

bool CanSetMin(long? minimum, bool fromDataAnnotation = false)

Parameters

minimum long?

The minimum value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given minimum value can be set for the sequence.

CanSetStartsAt(long?, bool)

Returns a value indicating whether the given starting value can be set for the sequence.

bool CanSetStartsAt(long? startValue, bool fromDataAnnotation = false)

Parameters

startValue long?

The starting value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given starting value can be set for the sequence.

CanSetType(Type?, bool)

Returns a value indicating whether the given type can be set for the sequence.

bool CanSetType(Type? type, bool fromDataAnnotation = false)

Parameters

type Type

The type of values returned by the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given type can be set for the sequence.

HasMax(long?, bool)

Sets the maximum value for the sequence.

IConventionSequenceBuilder? HasMax(long? maximum, bool fromDataAnnotation = false)

Parameters

maximum long?

The maximum value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.

HasMin(long?, bool)

Sets the minimum value for the sequence.

IConventionSequenceBuilder? HasMin(long? minimum, bool fromDataAnnotation = false)

Parameters

minimum long?

The minimum value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.

HasType(Type?, bool)

Sets the type of values returned by the sequence.

IConventionSequenceBuilder? HasType(Type? type, bool fromDataAnnotation = false)

Parameters

type Type

The type of values returned by the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.

IncrementsBy(int?, bool)

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

IConventionSequenceBuilder? IncrementsBy(int? increment, bool fromDataAnnotation = false)

Parameters

increment int?

The amount to increment between values.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.

IsCyclic(bool?, bool)

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

IConventionSequenceBuilder? IsCyclic(bool? cyclic, bool fromDataAnnotation = false)

Parameters

cyclic bool?

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

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.

StartsAt(long?, bool)

Sets the sequence to start at the given value.

IConventionSequenceBuilder? StartsAt(long? startValue, bool fromDataAnnotation = false)

Parameters

startValue long?

The starting value for the sequence.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionSequenceBuilder

The same builder instance if the configuration was applied, null otherwise.