-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move sequences modeling page out of relational and clean up
Part of #1669
- Loading branch information
Showing
7 changed files
with
43 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Sequences - EF Core | ||
author: roji | ||
ms.date: 12/18/2019 | ||
ms.assetid: 94f81a92-3c72-4e14-912a-f99310374e42 | ||
uid: core/modeling/sequences | ||
--- | ||
# Sequences | ||
|
||
> [!NOTE] | ||
> Sequences are a feature typically supported only by relational databases. If you're using a non-relational database such as Cosmos, check your database documentation on generating unique values. | ||
A sequence generates unique, sequential numeric values in the database. Sequences are not associated with a specific table, and multiple tables can be set up to draw values from the same sequence. | ||
|
||
## Basic usage | ||
|
||
You can set up a sequence in the model, and then use it to generate values for properties: | ||
|
||
[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/Sequence.cs?name=Sequence&highlight=3,7)] | ||
|
||
Note that the specific SQL used to generate a value from a sequence is database-specific; the above example works on SQL Server but will fail on other databases. Consult your specific database's documentation for more information. | ||
|
||
## Configuring sequence settings | ||
|
||
You can also configure additional aspects of the sequence, such as its schema, start value, increment, etc.: | ||
|
||
[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/SequenceConfiguration.cs?name=SequenceConfiguration&highlight=3-5)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
samples/core/Modeling/FluentAPI/Relational/SequenceUsed.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...luentAPI/Relational/SequenceConfigured.cs → ...deling/FluentAPI/SequenceConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters